Hi there,
First you check the mysql connection, i found common mistake, guys start the connection but not add in mysql, make sure the below
PHP Code:
$connection=mysql_connect($SQL_SERVER, $SQL_USER, $SQL_PASS);
$db=mysql_select_db($SQL_DBASE,$connection);
now make sure when you execute the sql
Check it again.
if it is ok!
Now Check the what data you get in results. if there is no data in result you get the same error.
Try the above.
Best of luck
Jitender