Moving back extra_data to items table

Results 1 to 5 of 5
  1. #1
    Apprentice Goldenn is offline
    MemberRank
    Aug 2013 Join Date
    5Posts

    Moving back extra_data to items table

    Currently i'm using Gold Tree Emulator a.k.a GTE (a Phoenix edit) which separate the extra_data column in items table into another table called "items_extra_data" .

    I find GTE unstable during 250-300 online causing disconnection issues so i want to use Phoenix back, The question is , how can i move back the column and the data of column 'extra_data' in 'items_extra_data' table back into items table ? It would be great if someone can give me the SQL to move it back into items table. Thanks .


    P/S: Sorry if my english is bad, If you don't understand, i'll try to explain more about it .


  2. #2
    R.I.P Millercent FatalLulz is offline
    MemberRank
    Nov 2012 Join Date
    AustraliaLocation
    2,248Posts

    Re: Moving back extra_data to items table

    Can you upload your data for the table? I can edit and create an SQL for you :)

    Other wise, Dump the table (So it exports the table), open the SQL, change it to insert into `items` and then insert into the extra_data column of the table.

  3. #3
    Apprentice Goldenn is offline
    MemberRank
    Aug 2013 Join Date
    5Posts

    Re: Moving back extra_data to items table

    This is my items_extra_data table https://mega.co.nz/#!aJpmWBYQ!9NlqAi...6eiVQX_CVzHAK0 .

    In the table there is two columns, 'item_id' and 'extra_data' . the data of extra_data column must be inserted into the id in items table which have the same id (item_id) as the one in items_extra_data table .

    The table is from my backups, so if you know how to do it, please tell me how, so i can do it by myself later once i do a maintenance on my hotel . I don't want to lose any data changes that my users have did currently on my hotel . Thanks .

  4. #4
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: Moving back extra_data to items table

    - Make a backup before you follow the next steps (Just incase.)
    - Add a new column called 'extradata' to your 'items' table.
    - Run this query:
    Code:
    UPDATE items INNER JOIN items_extra_data ON items.id = items_extra_data.item_id SET items.extradata = items_extra_data.extra_data
    Query may take a while to execute depending on the size of your database. Run it through navicat if it times out in PHPMyAdmin.
    What it does it joines the table items_extra_data on the 'items' table where the 'items.id' column matches with the 'items_extra_data.item_id' column and then sets the value for the 'extradata' column in the 'items' table.
    If you want to have the column a other name just replace 'extradata' with whatever you want.

    Let me know if this worked.

  5. #5
    Apprentice Goldenn is offline
    MemberRank
    Aug 2013 Join Date
    5Posts

    Re: Moving back extra_data to items table

    Quote Originally Posted by The General View Post
    - Make a backup before you follow the next steps (Just incase.)
    - Add a new column called 'extradata' to your 'items' table.
    - Run this query:
    Code:
    UPDATE items INNER JOIN items_extra_data ON items.id = items_extra_data.item_id SET items.extradata = items_extra_data.extra_data
    Query may take a while to execute depending on the size of your database. Run it through navicat if it times out in PHPMyAdmin.
    What it does it joines the table items_extra_data on the 'items' table where the 'items.id' column matches with the 'items_extra_data.item_id' column and then sets the value for the 'extradata' column in the 'items' table.
    If you want to have the column a other name just replace 'extradata' with whatever you want.

    Let me know if this worked.
    It works , Thanks .



Advertisement