Jump to content

Number of results problem


Cronje

Recommended Posts

I'm trying to determine the number of results from a SELECT, but am having trouble. My code:
$query = mysql_query("SELECT * FROM tablename WHERE name='xxx'");
$num = mysql_num_rows($query);

It works fine when 'xxx' is in the table, but when it finds none, 'echo $num;' doesn't display anything.

Help please!

-Cronje
Link to comment
https://forums.phpfreaks.com/topic/10936-number-of-results-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.