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 5 of 5
  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default MySQL > Switching data

    Hey, well, I have a database which has 2 tables:

    1 - newinfo
    2 - archive

    I want to be able to press a link, then whatever I choose from the newinfo goes into the archive.

    All I need is a code that can switch data in the database to another table.

    So I'd press "Put it in the Archive", it'd then be deleted from newinfo and be put into archive.

    Thanks.

  2. #2
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Just do it by getting the data from the newinfo table, putting it into the archive table and then delete the old data from newinfo. It may be a long method, but as far as I know it's the only way.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Thanks dude I'm not great with MySQL, anybody know the code
    Last edited by Hitman; 26-06-2007 at 01:05 PM.

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Well, first off, loop out all the newinfo table in to an array of data, then do another loop and put the data from the array in to the archive table.
    then just set sql to blank to old new info table "/

  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Its pretty easy to do this, take a look at a few of these functions

    www.php.net/while
    www.php.net/mysql_query
    www.php.net/mysql_fetch_array

Posting Permissions

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