Jump to content

PHP:Database issue


Cenron

Recommended Posts

I dont know why but everytime I run this command via mysql_query()

 

$sql = "SELECT `menu_id`,`module_id` 
		FROM `module_menu`
		WHERE `menu_id`=0 OR (`menu_id`='1' AND `module_id`='7')";

 

then I call mysql_num_rows();

 

if(!mysql_num_rows($result)) { continue; }

 

Without the `menu_id`=0 it works perfectly but when i put that  `menu_id`=0 OR mysql_num_rows() always returns a true. I DONT KNOW WHY there is only one field in the database that the menu_id=0 so MAX it should return 2 rows but most of the time it should return 0. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/111163-phpdatabase-issue/
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.