The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Edit Bulk Field in database
Hi,
Have a tricky question here and don't know if it can be done this way but maybe somebody might know. Lets say in the users table I want to change all the active users (there is a field called active and options are yes and no) So to all users with Active=Yes I would want to change another field in those users, I would want files "type" to =1. Basicly all Active and And Inactive users have a type=0 and I woudl want to change for active users for type to =1. Can this be done without going through hundreds of users and changing these files one by one? Thank You |
#2
|
|||
|
|||
[sql]UPDATE vb_user
SET type = '1' WHERE active = 'yes'[/sql] and replace "vb_" with whatever prefix you're using... If I understood you correctly? Please don't run that until someone much smarter than me confirms. LOL. |
#3
|
|||
|
|||
Thanks a lot, yes it working now. Oh And i have to put ' ' around yes to make it work.
|
#4
|
|||
|
|||
Try what I had edited it to.. I thought I edited it before you replied but I guess not. lol.
Quote:
Glad it works. |
#5
|
||||
|
||||
Should be:
[sql]UPDATE `vb_user` SET `type` = 1 WHERE `active` = 'yes'[/sql] Integers should not be encapsulated with quotes. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|