Jump to content

Pete666

New Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Pete666's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to insert rows from staffonblock table into the same staffonblock table. The new rows will have the same groupid and staffid as the selected rows but the newblockid and newblocksetid will be as provided by the variables. I'm calling the php file from a jQuery script using ajax and sending in the 4 variables but the ajax call returns an error, PHPMyadmin says the syntax of the php file is ok. Here is staffonblock table before the required insert: g1, s1, 1, 1 g1, s2, 1, 1 .. and eg what is required after insert: g1, s1, 1, 1 g1, s2, 1, 1 g1, s1, 2, 2 g1, s2, 2, 2 help appreciated. <?php include_once ('tl2_connect.php'); $instance = ConnectDb::getInstance(); $conn = $instance->getConnection(); $groupid = $_POST["groupid"]; $blockid = $_POST["blockid"]; $newblockid = $_POST["newblockid"]; $newblocksetid = $_POST["newblocksetid"]; $sql = "INSERT INTO staffonblock (groupid, staffid, blockid, blocksetid) SELECT groupid, staffid, ".$newblockid."', '".$newblocksetid."' FROM staffonblock WHERE blockid='".$blockid."' AND groupid='".$groupid."';" ; $conn->exec($sql) ?>
×
×
  • 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.