wwfc_barmy_army Posted May 20, 2011 Share Posted May 20, 2011 Hello, I just thought i'd check but i can't seem to find any information anywhere, Can you replace a query like this: SELECT * FROM tablename WHERE name = "name" OR name = "name2" OR name = "name3" with something like; SELECT * FROM tablename WHERE name = "name", "name2", "name3" or some shorthand way of having multiple where conditions on the same column? Thanks. Link to comment https://forums.phpfreaks.com/topic/236949-multiple-where-in-mysql/ Share on other sites More sharing options...
suresh_kamrushi Posted May 20, 2011 Share Posted May 20, 2011 You can do like this SELECT * FROM tablename WHERE name IN ("name", "name2", "name3") Thanks Link to comment https://forums.phpfreaks.com/topic/236949-multiple-where-in-mysql/#findComment-1217956 Share on other sites More sharing options...
wwfc_barmy_army Posted May 20, 2011 Author Share Posted May 20, 2011 Legend. Thanks. I'll give it a go Link to comment https://forums.phpfreaks.com/topic/236949-multiple-where-in-mysql/#findComment-1217957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.