I want to delete a row from my table and move that deleted row to another table.
Table Structure:
tbl_problem
- problem_id
- problem_date
- problem_title
tbl_problem_done
- problem_done_id
- problem_done_date
- problem_done_title
My query:
$sql = "INSERT INTO tbl_problem_done SELECT * FROM tbl_problem WHERE problem_id=$problem_id";
I can copy the data using the query above. Now I want to delete the data using this query:
"DELETE FROM tbl_problem WHERE problem_id=$problem_id";
How do I combine this query from the previous query?