Jump to content

mysql_num_rows error


abch624

Recommended Posts

Hi Guys I have this sql statement that I execute,

$sql_check_language="SELECT isoID FROM $tbl_languagetemplate WHERE isoID='$newlangaugeID'";
$result_check_language=mysql_query($sql_check_language);
$count=mysql_num_rows($result_check_language);

 

When I reach this code I get this error: "Query was empty"

 

I have 0 rows for this query in the database. I expect 0 to be returned.... Any help guys or any ways to catch this?

 

Cheers - Zahid

Link to comment
https://forums.phpfreaks.com/topic/114650-mysql_num_rows-error/
Share on other sites

can you execute this code and let me know the output:

 

$sql_check_language="SELECT isoID FROM $tbl_languagetemplate WHERE isoID='$newlangaugeID'";
$result_check_language = mysql_query($sql_check_language) or die(mysql_error());

 

and want to make sure have you created the connection....

Link to comment
https://forums.phpfreaks.com/topic/114650-mysql_num_rows-error/#findComment-589552
Share on other sites

I believe the problem is not in the query or PHP itself. But in a typo.

 

take a closer look:

$sql_check_language="SELECT isoID FROM $tbl_languagetemplate WHERE isoID='$newlangaugeID'";

WHERE isoID='$newlangaugeID'";

'$newlangaugeID'

langauge

 

there's your problem above.

 

Regards ACE

Link to comment
https://forums.phpfreaks.com/topic/114650-mysql_num_rows-error/#findComment-589563
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.