Jump to content

forumlogger

New Members
  • Posts

    1
  • Joined

  • Last visited

forumlogger's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.