Forum Moderators: coopster
SELECT statement
$result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){
I want to do something like:
If 0 rows are returned, then echo
else echo
Can you tell me how I can do this?
$result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result)){ // process the results } } else { echo 'No rows in result set.'; }