I have found plenty of examples on how to insert into using a select then delete however,
I am looking to move data from one table to another and the columns ARE NOT matched for example
table1 (id
, location
, lat
, lon
, date_added
)
table2 (id
, location
, lat
, lon
, date_added
, requested
)
essentially I would like to insert into table2 a row from table1 and add the $_SESSION['user_name'] to the requested field, and then delete the original row from the first table.
I have tried a few different things
$sql = "START TRANSACTION;
INSERT INTO bia_signs_pending (SELECT * FROM bia_signs WHERE id = ".$_GET['sign_id'].');
DELETE FROM bia_signs WHERE id = ' .$_GET['sign_id'].';
UPDATE bia_signs_pending SET requested=' .$_SESSION['user']['email'].
'WHERE id = '.$_GET['sign_id'].';
COMMIT;';
//this one breaks because the columns do not match
any suggestions?