Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8

Thread: MySQL Help

  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default MySQL Help

    Hello,

    I'm about to run something and I want to check this is definitely correct. It's going to be updating many rows.

    Right so I've got a database, and I'm in it in phpMyAdmin. I go into a table called cc_servers. Under structure it shows many fields, one is "messengercontrol".

    If I go into browse, there are hundreds of rows. I want to update messengercontrol in all these rows to "enabled".

    Do I run this SQL:

    UPDATE cc_servers SET messengercontrol=enabled ;

    Will that be ok? I'm not 100%.

    Thanks.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  2. #2
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    Im pretty sure it would be "UPDATE `cc_servers` SET `messengercontrol` = 'enabled';" I'm not 100% sure of this, so you may want to wait for another member to post as well.
    Last edited by Joe!; 21-07-2008 at 07:01 PM.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  3. #3
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by Joe! View Post
    Im pretty sure it would be "UPDATE `cc_servers` SET `messengercontrol` = 'enabled';" I'm not 100% sure of this, so you may want to wait for another member to post as well.
    Correct.

  4. #4
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Alright, I just want to be 100% sure, if I'm running it on phpMyAdmin I just enter:

    UPDATE `cc_servers` SET `messengercontrol` = 'enabled';

    And that'll work? (without "" around it)

    Also, will this set each row to have messengercontrol enabled - even if some have it enabled already?
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    ye thatl work
    Coming and going...
    Highers are getting the better of me

  6. #6
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by iUnknown View Post
    Alright, I just want to be 100% sure, if I'm running it on phpMyAdmin I just enter:

    UPDATE `cc_servers` SET `messengercontrol` = 'enabled';

    And that'll work? (without "" around it)

    Also, will this set each row to have messengercontrol enabled - even if some have it enabled already?
    It will set all the rows enabled and will just surpass the ones already enabled I'm guessing.

  7. #7
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Both ways will work, just the second one posted is better syntax.


  8. #8
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    If you have some rows enabled..

    Code:
    UPDATE `cc_servers` SET messengercontrol = 'enabled' WHERE messengercontrol = 'disabled'
    No use updating every row even if it is enable.

    If the all the rows are blank..

    Code:
    UPDATE `cc_servers` SET messengercontrol = 'enabled' WHERE messengercontrol = ''

Posting Permissions

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