monkeybidz Posted September 9, 2007 Share Posted September 9, 2007 I have this query: "SELECT * FROM sb_members WHERE sb_gender=1 order by sb_id desc"; Is it possible to have the query select sb_gender if it =1, 2,or 3? Would it be something like this? "SELECT * FROM sb_members WHERE sb_gender=1,2,3 order by sb_id desc"; No clue! ??? Link to comment https://forums.phpfreaks.com/topic/68597-solved-php-sql-query/ Share on other sites More sharing options...
monkeybidz Posted September 9, 2007 Author Share Posted September 9, 2007 Got it, i used this: "SELECT * FROM sb_members WHERE sb_gender=1 or sb_gender=2 or sb_gender=3 order by sb_id desc"; Link to comment https://forums.phpfreaks.com/topic/68597-solved-php-sql-query/#findComment-344832 Share on other sites More sharing options...
monkeybidz Posted September 9, 2007 Author Share Posted September 9, 2007 Seems it only worked in some pages, but not in others. How can i do so that: sb_gender = 1 2 or 3? Link to comment https://forums.phpfreaks.com/topic/68597-solved-php-sql-query/#findComment-344912 Share on other sites More sharing options...
lightningstrike Posted September 9, 2007 Share Posted September 9, 2007 SELECT * FROM sb_members WHERE sb_gender IN ('1','2','3') ORDER BY sb_id DESC should do what you want. Link to comment https://forums.phpfreaks.com/topic/68597-solved-php-sql-query/#findComment-344913 Share on other sites More sharing options...
monkeybidz Posted September 9, 2007 Author Share Posted September 9, 2007 Outstanding, It works great. What would i do without you guys. Thanks a million! Link to comment https://forums.phpfreaks.com/topic/68597-solved-php-sql-query/#findComment-344931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.