SirChick Posted December 9, 2007 Share Posted December 9, 2007 I keep getting "Query was empty" with one of my queries.. so was wondering what can i add to my queries when it returns that error to know which query is producing it ? I have so many to check and I am unable to check why its empty without knowing what query is create this error in the first place.. what do you usually put to find out? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted December 9, 2007 Share Posted December 9, 2007 on a select you should always check <?php $q = "Select this from `that`"; if(!empty($q)){ //The query is not empty so execute $r = mysql_query($q) or die(mysql_error()); if(mysql_num_rows($r)>0){ //Proceed to work on query results } else{ //alert empty return } } else{ //alert empty query } 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.