PDA

View Full Version : SOS -Multiple records updated to a different usergroup via query


Angela Morris
Fri 3rd Mar '06, 12:37am
I'm trying to update about 900 records, setting them all to usergroup 4 (Coppa status) I have the record numbers but my attempts to do am update query have failed miserably. So I tried individual row queries for updates - that worked.

update forum_user set usergroupid = 4 where userid = 13

but it won't let me do multiple rows of this.

I had previously tried update forum_user set usergroupid = 4 where id in
(select forum_user.userid from forum_user
inner join forum_userfield on
forum_user.userid = forum_userfield.userid
where forum_userfield.field5 = '') and that didn't work either.

I would like to do a variant where I update the userid fields to usergroupid = 4 with some sort of string of data -IE: 2,4,6,7,10 etc... so I can get all 900 or so records updated.

anyone have any idea how to get this to work? I'm using MySQL 4.0.25

Thanks!

Zachery
Fri 3rd Mar '06, 2:34am
Do you just want to mass move users who are in usergroup 4 to a new usergroup? Or are you trying to clear data?

Angela Morris
Fri 3rd Mar '06, 2:54am
Do you just want to mass move users who are in usergroup 4 to a new usergroup? Or are you trying to clear data?

wanted to move them - I ended up using the single line query with a ; between each line

but being able to update via a query though - where the userid is updated to a different user group based on the profile field being updated or not is my optimal choice. My users have to put in their names into a field to not be considered coppa level... not too different from people needing to put the licence # in here to be able to post.

Zachery
Fri 3rd Mar '06, 3:04am
You do know there is a mass user prune move option already?

AdminCP > Users > Move / Prune Users


I imagine that it would have been less of a headache this way.

Angela Morris
Fri 3rd Mar '06, 11:08am
You do know there is a mass user prune move option already?

AdminCP > Users > Move / Prune Users


I imagine that it would have been less of a headache this way.

It would be if it worked with custom fields - it only works with pre-established data