Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: help with activation/script
02-03-2010, 12:50 PM #1
- Join Date
- Feb 2010
- Thanked 0 Times in 0 Posts
help with activation/script
I have a members area, where users sign up using register.php, which then emails us to activate them. We will then log into our admin panel to activate any users not yet activated. Each user will only be allowed specific access to certain areas of the site i.e. if they own 2 products out of four they can only access support pages relating to those products. The access levels will be set when we activate the user. (have i lost you yet?)
I have the majority of scripts working, the only bit i'm stumped with is the activation. Ideally, i'd like to retrieve all users from mysql db with the field activated=0 (so not activated) into a table, which i can do and have got set up. Then....
This is where i get lost: i want to make a form for each user retrieved into the table above, with checkboxes for each area i want to allow them to, all within the same table and once submitted will activate each user at a time.
Any ideas on the script? I can supply what i have now if needed?
02-03-2010, 01:08 PM #2
- Join Date
- Dec 2009
- Thanked 58 Times in 58 Posts
Once you pass all the id's back to php with the ones you want to activate, simply use
UPDATE user_table_name SET active='true' WHERE user_id_field IN(1,2,3,4,5)
1,2,3,4,5with a list of id's. If you do this right, you can just implode the list of id's using a
,as the glue, and then insert that into the string. Be sure to replace the column and table names with the correct ones. That one query will set all the id's in the braces to active