Home >Backend Development >PHP Tutorial >为什么php这样写会死循环

为什么php这样写会死循环

WBOY
WBOYOriginal
2016-06-02 11:34:491760browse

php

$sql="select * from user";
$res=mysql_query($sql);
$row=mysql_fetch_row($res);
while($row) {
echo 'A row';
}
以上代码会死循环而下面的正常
$sql="select * from user";
$res=mysql_query($sql);

while($row=mysql_fetch_row($res)) {
echo 'A row';
}
为什么第一种会死循环呢

Statement:
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