Andy11548 Posted March 3, 2012 Share Posted March 3, 2012 I need this query to select 2 different pieces of information from the database using a $_GET method. But how do I make it so that I can have more than one WHERE? SELECT f1.cat_id as CatID, f1.cat_name as CatName, f2.sub_id as SubID, f2.sub_name as SubName FROM forum_cats as f1 LEFT JOIN forum_sub as f2 ON f1.cat_id = f2.cat_id WHERE f1.cat_id = '$cat' I need it to also do WHERE f2.sub_id = '$sub' I tried using the AND feature, but it doesn't work how I want it too. Thanks in advance, Andy. Link to comment https://forums.phpfreaks.com/topic/258206-multiple-where-values-in-a-query/ Share on other sites More sharing options...
Andy11548 Posted March 3, 2012 Author Share Posted March 3, 2012 Worked it out Link to comment https://forums.phpfreaks.com/topic/258206-multiple-where-values-in-a-query/#findComment-1323591 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.