inserting, and then deleting from MySQL-PHP, advice needed!

Hello,

I am trying to figure out how to go about doing this:

I run a query, once query is finished then I want it to insert the results to a different table then delete the results from the table they came from, please help

Chris

Do an “INSERT” query into the one table, then a DELETE query in the other…

SELECT * FROM table1 WHERE condition1=value1 AND condition2=value2 … conditionN=valueN
Then you can Insert using the following format:
INSERT INTO table2 VALUES(‘value1’, ‘value2’, ‘value3’, …, ‘valueN’)
Finally you can now delete using the following format
DELETE FROM table1 WHERE condition1=value1 AND condition2=value2 … conditionN=valueN

Although this is not the only or definitive way to do it, it’s the best I can do given the info provided.

This perhaps? :)
Like Peg110 said, you’ve provided very little info.

Sponsor our Newsletter | Privacy Policy | Terms of Service