Jump to content

copy info in MYSQL DB into same DB with different date ref


ppgpilot

Recommended Posts

I used to code a long time ago - PHP5.

 

It is slowly coming back to me but not fast enough...

 

I need to copy data from a mysql data base and put it back in unchanged with another date reference.

 

This is a calorie recorder that tracks daily calories - food type, calories, protein, carbs, etc.

 

I simply want to take each entry in that day, then copy it exactly except changing the date recerence.

 

If I could say "copy all entires where date = (date) into DB  with new date (date), that would do it.

 

The only thing I can think to do is pull each item out  and place it back into the DB with a while statement.

 

There has to be an easier way...

 

If that is my only option, I need to figure out how to create a while statement to handle an array to do the job.

 

Any thoughts?

 

Thanks for the help!!

 

David

 

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.