...

View Full Version : how would I write this query?



zeroality
07-23-2006, 06:16 AM
I need to know how to write a mySQL query. I have a table called 'users' with about 4,200 users in it and I need to modify the 'usergroupid' value in all of these tables and change them from 0 to 2 for all 4,200 users.

How would I write that? (example below)

INSERT INTO phpbb_config (config_name, config_value) VALUES ('points_name','Points');

So I need a line(or lines) like that which will let me update all 4,200 users at once as I described above.

guelphdad
07-23-2006, 07:00 AM
use update.

zeroality
07-23-2006, 07:08 AM
In more specific terms, I need for someone to write the one line of mySQL code for me.

GJay
07-23-2006, 10:08 AM
That's not really how things tend to work.
Have a look at UPDATE, and try yourself, then come back with what you've tried, and explain any problems.
Here's the manual page:
http://dev.mysql.com/doc/refman/5.0/en/update.html

guelphdad
07-23-2006, 03:33 PM
In more specific terms, I need for someone to write the one line of mySQL code for me.

So does that mean

a) you've never opened the manual? What you are asking for is extremely basic

b) this is homework and you can't figure it out and would like someone to give you the answer

c) you can't be bothered to put the effort in that would be needed

d) you've never used mysql before posting this question (or are still very new at it) and need help.

If it is the latter, then let people know. We have no ways of knowing what background you have in using mysql. The latter will get you an answer if you are willing to work at it. The first three basically won't.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum