为什么mysql_fetch_array/assoc + foreach只能遍历一条记录
foreach(mysql_fetch_array($result) as $key=>$row){<br /> <br /> print_r($row);<br /> <br /> }
这样只能遍历输出最后一条记录
下面这样就能全部遍历,是不是说明数据库返回的数组与平常的不同?
while($row=mysql_fetch_array($result)) <br />{ <br /> $rows[] = $row; <br />} <br /><br />foreach($rows as $k => $v) <br />{ <br /> foreach($v as $vv){<br /> echo $vv;<br /> }