Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Cool Unanswered: Adding data from one table to another

    Hi guys,
    Noob here and i really need some help with my phpmyadmin mysql database
    i have two tables "Survivor" which has columns: id,unique_id,world_id,worldspace,inventory and "Profile" which has columns: id, unique_id,name, what i need to do is add a column "name" to the "survivor" table which corresponds with a number value in "unique_id" which is the same number in both tables, if anyone could show me a query to achieve this i would be unbelievably grateful, thanks so much to any that take the time to help

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    Suggest you post a few sample rows from both tables as they are now and what you want after your query has run.

  3. #3
    Join Date
    Oct 2012
    Posts
    3
    Hi so basically as above need to add a column "name" to "survivor" table.
    both tables have "unique_id" column with a numerical value that is the same in both tables, just want to have names next to unique Id in the survivor table as well sorry I'm away from computer ATM so can't post an example but it's pretty self explanatory

  4. #4
    Join Date
    Mar 2004
    Posts
    480
    that column isn't necessary, you would do a join on the two tables to find the info. Don't store redundant data.

  5. #5
    Join Date
    Oct 2012
    Posts
    3
    Ok could you give me the query to join the 2 tables?

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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