I am confused !!.. ( quickness's easy really )
My insert query doesnt work
$copy_id = $_POST['id'];
$query = "CREATE TEMPORARY TABLE tmptable_1 SELECT * FROM clients WHERE id=" . $copy_id . " ; ";
$query .= " UPDATE tmptable_1 SET id = NULL;";
$query .= " INSERT INTO clients SELECT * FROM tmptable_1;";
$query .= " DROP TEMPORARY TABLE IF EXISTS tmptable_1;";
$myfile = fopen("newfile.txt", "w") ;
$txt = $query;
fwrite($myfile, $txt);
fclose($myfile);
$cpy = db::query($query);
if I look at the newfile.txt it says
CREATE TEMPORARY TABLE tmptable_1 SELECT * FROM clients WHERE id=37 ; UPDATE tmptable_1 SET id = NULL; INSERT INTO clients SELECT * FROM tmptable_1; DROP TEMPORARY TABLE IF EXISTS tmptable_1;
If I run that in mysql..voila works great
but the db::query does nothing ?
What am I doing wrong