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

为什么php这样写会死循环

WBOY
Release: 2016-06-02 11:34:49
Original
1758 people have browsed it

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';
}
为什么第一种会死循环呢

Related labels:
php
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