Originally posted by Randomizer
if ($x = 0)
[/B]
if($x==0)
What if($x=0) does is set $x equal to zero, and then tests to see if the result is nonzero.
I often use a template resembling:
$query='SELECT blah...';
$query_result=sql_query($query);
$query_numrows = sql_num_rows($query_result);
if(!$query_numrows) // Convenient shorthand for $query_numrows==0
{ // Handle case of empty resultset
}
else
{ for($i=0; $i<$query_numrows; $i++)
{ $row = sql_fetch_array($query_result);
// Foo
}
}
Eewwwww... <font> tags!