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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
spiceydog Posted July 13, 2008 Author Share Posted July 13, 2008 than you!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.