cip6791 Posted August 23, 2008 Share Posted August 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
AjBaz100 Posted August 23, 2008 Share Posted August 23, 2008 when the script that runs deletes the ad, you could add another query to first insert the records into another table. I can't remember the exact syntax of the top of my head, but if you look into using the INSERT INTO query. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 23, 2008 Share Posted August 23, 2008 try something like Insert into `emails` (AdName, Email) Values(Select Name, Email from `ads` where Id = IDHERE)) and then delete Quote Link to comment Share on other sites More sharing options...
fenway Posted August 25, 2008 Share Posted August 25, 2008 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? Quote Link to comment Share on other sites More sharing options...
Mchl Posted August 25, 2008 Share Posted August 25, 2008 Why not insert email when inserting the ad, not when deleting it? You'll need it anyways. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.