If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Aug 2003
    Member #
    I have a client that had me remove a couple of fields (address, city, state, zip) from a form that stores it entries in a MySQL database. After 3 months, they decided that they wanted those same fields back in and asked if not only I could add them back in, but add the values back in to the previous form submissions too.

    Fortunately, I created a database backup around this time in a text file so I pretty much have the field values still.

    Is there an easy way to add these back into the database? I am inexperienced with writing MySQL commands so I am not sure what is feasible, but here is what I am thinking:

    The original field ids are 162 (address), 163 (city), 164 (state) and 165 (zip). The new field id's are 341 (address), 342 (city), 343 (state) and 344 (zip). The form user's name is field id 160. If this is possible, I want to write some sort of command that would match the form user's name, then enter the value of 162 into 341, 163 into 342, 164 into 343 and 165 into 344.

    Is this possible? Is there some other easy way to do this? There are about 150 entries I need to do this with, so manually inputting them back into the system seems overwhelmingly tedious.

    Any advice is greatly appreciated.


  3. #2
    Member Brillig's Avatar
    Join Date
    Mar 2010
    Member #
    Maybe some tricky things you can do with the text file, a good editor and some regular expression replacements to create a list of updates.

    But you might do better with a tool like Access that lets you view the table in a grid view. Then if you can have it sorted the same way as your text file you might be able to cut and paste.

    The other option is, if you truly backed it up, you can restore it to another table name. Then it would be a simple join to update the original table. A scientific/statistical approach to win prizes online.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 07:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: