Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    how would I write this query?

    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.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    use update.

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    In more specific terms, I need for someone to write the one line of mySQL code for me.

  • #4
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    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

  • #5
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Quote Originally Posted by zeroality
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •