I have tested this query in phpmyadmin & it returns exactly what I'm looking for...it duplicates row1 & updates the title to DUPLICATE.
$sql = "CREATE TEMPORARY TABLE tmp
SELECT `unit_id`,
`title`,
`status_id`,
`category_id`,
`tags`,
`access_id`
FROM unit_genData
WHERE `unit_id`='1';
ALTER TABLE tmp
DROP COLUMN `unit_id`;
UPDATE tmp
SET `title` = 'DUPLICATE';
INSERT INTO unit_genData
SELECT 0,tmp.*
FROM tmp;
DROP TABLE tmp;";
Then I go and add it to a php page, and...
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ALTER TABLE tmp DROP COLUMN
unit_id; UPDATE tmp ' at line 10
Why am I getting this error?