Cenron Posted June 20, 2008 Share Posted June 20, 2008 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? Quote Link to comment Share on other sites More sharing options...
andrewgarn Posted June 20, 2008 Share Posted June 20, 2008 missing quotes around the 0? WHERE `menu_id`= '0' Quote Link to comment Share on other sites More sharing options...
Cenron Posted June 20, 2008 Author Share Posted June 20, 2008 tried both ways does nothing. Quote Link to comment Share on other sites More sharing options...
Barand Posted June 20, 2008 Share Posted June 20, 2008 I DONT KNOW WHY there is only one field in the database that the menu_id=0 we don't know why either. Quote Link to comment Share on other sites More sharing options...
widox Posted June 20, 2008 Share Posted June 20, 2008 How about it's a logic error. What do the rows in your DB look like? Need more info. Quote Link to comment Share on other sites More sharing options...
Cenron Posted June 20, 2008 Author Share Posted June 20, 2008 the table is simple....It looks like this ID - int(11) AUTO_INCREMENT menu_id - int(11) module_id - int(11) Thats all there is to that table. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.