I have two tables. One table is intended as a transaction history, and the other is a member details log. When the report runs, I want to move parts of the participant’s details to the transaction history, but ALSO update some field entries that would not otherwise exist.
Is it possible to select all records that meet certain criteria, insert only individual parts of the corresponding row into another table, and update other fields in one query?
For instance:
In table 2, I have the member name, date of registration, and member. I want to move the above entries to table 1, but also update the field (status) equal to "processed".
Note. I also use php and pdo to connect to mysql database.
Is this possible in a single request?
source
share