PDA

View Full Version : querry for secondary usergroups??


Dankness
16 Feb 2007, 12:25
Hello i have been tryin to figure out the proper operator to modify all users in a secondary user group. Which the table row would be

TABLE_PREFIX . 'user where membergroupids = 'is this possible?';

Basicly, i just need a method to check if say #1 is inside of the array stored in membergroupids.

Thanks
Shawn

Marco van Herwaarden
16 Feb 2007, 13:57
Check the MySQL function FIND_IN_SET()

http://dev.mysql.com/doc/refman/4.1/en/string-functions.html

Dankness
16 Feb 2007, 22:53
Check the MySQL function FIND_IN_SET()

http://dev.mysql.com/doc/refman/4.1/en/string-functions.html

ok thank you for the tip, i have figured some of this out when i run the following querry in phpWebAdmin then it lists what im looking for.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



but when i use it in a php querry then it gives a invalid sql syntanx



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



EDIT SOLVED:

After playing around with it for awhile i found this which works



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Marco van Herwaarden
17 Feb 2007, 08:12
I hope you are not planning to use that query like this in your final code?

Never use unsanitised variables in a query (like $_POST).