while遍历结果集解决思路

WBOY
Release: 2016-06-13 12:58:25
Original
931 people have browsed it

while遍历结果集
for遍历。

$num=mysql_num_rows($result);<br />
for($i=0;$i<$num;$i++)<br />
{<br />
    $row=mysql_fetch_assoc($result);<br />
    $arr[]=$row;<br />
}
Copy after login


while的条件怎么填- -。 貌似我好像见过。貌似忘了。
------解决方案--------------------
while($row=mysql_fetch_assoc($result)){<br />
  $arr[]=$row;<br />
}
Copy after login

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