Hi,
I have a variable that could contain a variable amount of unqueid’s separated by a (,)
I need to check each name against the database and get the username for each individual. The example below won’t work as it’s one string.
This above example would be useless as it would look like.
SELECT username FROM wces_users WHERE uniqueid = ' 1,2,3,4’
What is need is:
SELECT username FROM wces_users WHERE wce_uid = ' 1 ' OR wce_uid = '2' wce_uid = '3' etc, etc.
If someone could point me in the right direction of breaking the string up to help build my SQL query it would be most appreciated. Thanks in advance.
I have a variable that could contain a variable amount of unqueid’s separated by a (,)
I need to check each name against the database and get the username for each individual. The example below won’t work as it’s one string.
Code:
wce_user = "1,2,3,4 ' ‘This could be any number of unique id’s
qry_user = "SELECT * FROM wces_users WHERE uniqueid = '"&(wce_user)&"'"
This above example would be useless as it would look like.
SELECT username FROM wces_users WHERE uniqueid = ' 1,2,3,4’
What is need is:
SELECT username FROM wces_users WHERE wce_uid = ' 1 ' OR wce_uid = '2' wce_uid = '3' etc, etc.
If someone could point me in the right direction of breaking the string up to help build my SQL query it would be most appreciated. Thanks in advance.