John Cartwright wrote:Why?
Woah...
It's an assignment in a condition. PHP is a language that allows you to write bad code without any side effects. This, however, does not mean it is a good idea to write bad code.
Basically, the proper way would be to:
Code: Select all
$row = mysql_fetch_row(...);
while ($row)
{
...
$row = mysql_fetch_row(...);
}
This could be also done like:
Code: Select all
while (($row = mysql_fetch_row(...) == true))
or if you simplify that:
Code: Select all
while (($row = mysql_fetch_row(...)))
Are extra parenthesis required? Not for making it to work, but in the sake of proper code, yes.
I think above posters do not code C/C++?