Jump to content

MySql copy from one table to another


cip6791

Recommended Posts

Hi all,

 

I have a question. I currently use a classifieds script that deletes the ad after a certain amount of time. So I lose the e-mail which was used to post the ad. I would like to copy the existing email from the ads table to another table and keep them there for future use. Does anybody have any idea how this can be done? I would like it to be automatically copied into the new table.

 

Thanks

Link to comment
Share on other sites

try something like

Insert into `emails` (AdName, Email) Values(Select Name, Email from `ads` where Id = IDHERE))

and then delete

No, not at all... that won't work.

 

I have a question. I currently use a classifieds script that deletes the ad after a certain amount of time. So I lose the e-mail which was used to post the ad.

Why not use a datetime field to mark the record as expired, instead of deleting it?

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.