coder9 Posted July 26, 2008 Share Posted July 26, 2008 ok I'm not sure if this is possible using single mysql query only. Let say i have 5 numbers. 9, 30, 40, 23 and 88 I want to search for these numbers from a table and show me who is the employee who own this number on each equivalent number. let say joseph = 9, john = 30, karen = 40, warren = 23 and george = 88. A BIG Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/116703-how-to-find-5-numbers-from-100-records-using-php-mysql/ Share on other sites More sharing options...
Barand Posted July 26, 2008 Share Posted July 26, 2008 SELECT id, name FROM employee WHERE id IN (9, 30, 40, 23, 88) Link to comment https://forums.phpfreaks.com/topic/116703-how-to-find-5-numbers-from-100-records-using-php-mysql/#findComment-600047 Share on other sites More sharing options...
rawb Posted July 26, 2008 Share Posted July 26, 2008 SELECT * FROM tablename WHERE (id='9' OR id='30' OR id='40' OR id='23' OR id='88') Should return what you need. Link to comment https://forums.phpfreaks.com/topic/116703-how-to-find-5-numbers-from-100-records-using-php-mysql/#findComment-600048 Share on other sites More sharing options...
coder9 Posted July 26, 2008 Author Share Posted July 26, 2008 SELECT id, name FROM employee WHERE id IN (9, 30, 40, 23, 88) Thank you very much BARAND! I now understand why you hate immature people. practice, practice, practice, practice, practice, practice................................................................! Link to comment https://forums.phpfreaks.com/topic/116703-how-to-find-5-numbers-from-100-records-using-php-mysql/#findComment-600051 Share on other sites More sharing options...
coder9 Posted July 26, 2008 Author Share Posted July 26, 2008 i already read this many times before but i always forgot, maybe that's because i'm always immature. lol Link to comment https://forums.phpfreaks.com/topic/116703-how-to-find-5-numbers-from-100-records-using-php-mysql/#findComment-600052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.