Jump to content

query checking


SirChick

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.