Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty Sets 1

Status
Not open for further replies.

MrPantsTm

Programmer
Joined
Jan 22, 2004
Messages
71
Location
US
How do I detect for Empty Sets that are returned by MySQL? I go through the database and do some queries which have some text before them to identify them. The ones that return nothing I'd like to not display the text to identify them. Thanks!
 
$result=mysql_query($query);
$num_results=mysql_num_rows($result);

if($num_results > 0){
//do something;
}else{
echo "0 results returned";
}

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top