Jump to content

PHP/MYSQL copy fields in table to new table if data exists in fields


Guest elthomo

Recommended Posts

Guest elthomo

PHP/MYSQL copy fields in table to new table if data exists in fields.

 

To simplify I have some address data that I want users to be able to update but I also want to keep the old address. Could someone let me know the correct syntax for this?

Link to comment
Share on other sites

Guest elthomo

No I understand the logic, but I'm unsure of the syntax. So what I would like to know is the syntax and not have the code written for me. I have unsuccessfully googled for the info required and could just use a little help.

Link to comment
Share on other sites

Guest elthomo

Actually I think I may have found what I need INSERT INTO table_name SELECT * FROM table_name2 WHERE Field_Name = $field_name AND Field_Name2 = $$field_name2

Link to comment
Share on other sites

Why are you copying this into another table? You going to create a new table every time a person's address changes ;)

Just have it all in 1 table, and have a timestamp on the information. Then just pull the latest information using MAX(timestamp_column).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.