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? Link to comment https://forums.phpfreaks.com/topic/80926-query-checking/ 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 } Link to comment https://forums.phpfreaks.com/topic/80926-query-checking/#findComment-410563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.