nita Posted May 20, 2007 Share Posted May 20, 2007 Hi I would like to do query which is searching only records with "Menuideas" in subcategory column. my code is : $result1 = mysql_query("SELECT * FROM recipe WHERE subcategory='Menuideas' and WHERE name LIKE '%$search%' OR ingred LIKE '%$search%' ORDER BY name LIMIT $offset, $rowsPerPage"); i'm not sure if WHERE and WHERE is the correct syntax in this case ?? Need some help with this one... please Nita Quote Link to comment https://forums.phpfreaks.com/topic/52271-solved-php-mysql-query-problem-where-and-where/ Share on other sites More sharing options...
nita Posted May 20, 2007 Author Share Posted May 20, 2007 i fixed the code (little bug) $result1 = mysql_query("SELECT * FROM recipe WHERE subcategory='Menuideas' AND name LIKE '%$search%' OR ingred LIKE '%$search%' ORDER BY name LIMIT $offset, $rowsPerPage"); Quote Link to comment https://forums.phpfreaks.com/topic/52271-solved-php-mysql-query-problem-where-and-where/#findComment-257912 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.