spiceydog Posted July 13, 2008 Share Posted July 13, 2008 I have a simple query echoing a list of things. I want a simple if test to say something special if the query turns up no results but I'm not sure how... does anyone here know how to fix that? Link to comment https://forums.phpfreaks.com/topic/114544-solved-checking-if-the-query-is-empty/ Share on other sites More sharing options...
paul2463 Posted July 13, 2008 Share Posted July 13, 2008 $query = "Blah blah blah"; $result = mysql_query($query) or die ("Error in query " . mysql_error()); $rows = mysql_num_rows($result); if ($rows < 1) { echo "Oops no rows returned"; } else { blah blah blah echoing out your data } hope that helps Link to comment https://forums.phpfreaks.com/topic/114544-solved-checking-if-the-query-is-empty/#findComment-589024 Share on other sites More sharing options...
spiceydog Posted July 13, 2008 Author Share Posted July 13, 2008 than you!!!!! Link to comment https://forums.phpfreaks.com/topic/114544-solved-checking-if-the-query-is-empty/#findComment-589030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.