tyweed Posted June 17, 2008 Share Posted June 17, 2008 I'm completely confused as to why this is not working? I have a comma seperated list of variables i check using the in shortcut vs having to list multiple or's. ============== table example query================ id user_id groupname 1 1 test 2 3 test 3 2 test 23 1 thisisnew 22 10 test ============================================= Select user_id from user_id_groupname where groupname in ('test,thisisnew') is returning zero? but Select user_id from user_id_groupname where groupname='test' or groupname='thisisnew' returns: The corret response user_id 1 3 2 1 10 I have no idea what is heppening I though in is just a shorthand for testing multiple or's? whats going on? Quote Link to comment https://forums.phpfreaks.com/topic/110651-solved-trying-to-use-in-shortcut-its-giving-me-zero-returned-but-long-way-works/ Share on other sites More sharing options...
hitman6003 Posted June 17, 2008 Share Posted June 17, 2008 each item in the IN clause should be separate: SELECT ... FROM ... WHERE groupname IN('test', 'thisisnew') Quote Link to comment https://forums.phpfreaks.com/topic/110651-solved-trying-to-use-in-shortcut-its-giving-me-zero-returned-but-long-way-works/#findComment-567666 Share on other sites More sharing options...
tyweed Posted June 17, 2008 Author Share Posted June 17, 2008 boy am i stupid thanks! Quote Link to comment https://forums.phpfreaks.com/topic/110651-solved-trying-to-use-in-shortcut-its-giving-me-zero-returned-but-long-way-works/#findComment-567675 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.