while 嵌套if 没法执行

WBOY
Release: 2016-06-13 12:45:42
Original
1073 people have browsed it

while 嵌套if 无法执行

<br />
$result = mysql_query("select title  from hello where title like '%$info%'");<br />
<br />
while($row=mysql_fetch_array($result))//通过循环读取数据内容<br />
  {<br />
    if(!$row)<br />
     {<br />
     	echo '1';<br />
     }<br />
     else<br />
     {<br />
     	echo '2';<br />
     }<br />
<br />
  }<br />
<br />
Copy after login


以上语句中,只有当$row有结果的时候才会输出,就是说只会输出2,而没结果的时候,没有任何输出,即不会输出1,不知道啥原因,求解。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template