#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    8
    Rep Power
    0

    Update live table with the back up


    Hi All

    I got my backup table (Commlogin_Buckup) in mysql database with my live database (Commlogin)

    Now as my live database is missing records in column batch, I want to insert the missing records were my Id key is equal to each other now I ran a script that I wrote but, I see that a lot of the records in Batch updated as ' ' Empty field??? When I Look at the original backup table the information is there?


    Code:
    UPDATE commlogin INNER JOIN commlogin_Backup ON commlogin_Backup.id = commlogin.id SET commlogin.batch = commlogin_Backup.batch
    What I'm I doing wrong?
  2. #2
  3. No Profile Picture
    Problem Solver
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2001
    Location
    Stockholm, Sweden
    Posts
    4,495
    Rep Power
    534
    Double check that your join condition is correct.

    If there isn't a match (possible whitespace characters) the original value, which I'm assuming is the blank string, will not be changed.
    /Stefan
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    8
    Rep Power
    0
    Originally Posted by sr
    Double check that your join condition is correct.

    If there isn't a match (possible whitespace characters) the original value, which I'm assuming is the blank string, will not be changed.
    Thank you, I saw my mistake.

IMN logo majestic logo threadwatch logo seochat tools logo