Minase Posted October 23, 2009 Share Posted October 23, 2009 i have a table with users and i want to select everything from certain users like select * from users where ID = 1 AND ID =2 this should return the 2 rows ... how can i achieve this? thank you Quote Link to comment https://forums.phpfreaks.com/topic/178729-solved-multiple-select/ Share on other sites More sharing options...
cags Posted October 23, 2009 Share Posted October 23, 2009 An ID of a row can't possibly be 1 AND 2. I think you mean OR. Quote Link to comment https://forums.phpfreaks.com/topic/178729-solved-multiple-select/#findComment-942795 Share on other sites More sharing options...
Minase Posted October 23, 2009 Author Share Posted October 23, 2009 after i posted i was thinking about it :| OR was what i needed thank you Quote Link to comment https://forums.phpfreaks.com/topic/178729-solved-multiple-select/#findComment-942796 Share on other sites More sharing options...
kickstart Posted October 23, 2009 Share Posted October 23, 2009 Hi As above or:- select * from users where ID IN (1,2) All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/178729-solved-multiple-select/#findComment-942798 Share on other sites More sharing options...
Minase Posted October 23, 2009 Author Share Posted October 23, 2009 thanks for quicker solution Quote Link to comment https://forums.phpfreaks.com/topic/178729-solved-multiple-select/#findComment-942801 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.