5 Replies Latest reply on Nov 13, 2008 5:05 AM by Waleed Barakat

    Problem executing custom transaction on update

      Hello

      I have a dynamic form wizard that works perfect for its own purpose for inserts and updates into a "jobs" table.

      I now want to insert statistical data to another table "jobs_stats" every time the an update is made to the "jobs" table.

      I have inserted a custom transaction (shown below) but sadly it never seems to execute (I have added simple SQL for now till the transaction is functional).

      Any help gladly appreciated...

      Regards Paul


      // Make a custom transaction instance
      $customTransaction = new tNG_custom($conn_connServer);
      $tNGs->addTransaction($customTransaction);
      // Register triggers
      $customTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
      // Set custom transaction SQL
      $customTransaction->setSQL("INSERT INTO `jobs_stats` (`stat_id`, `job_ref`, `user_ref`, `stat_date`) VALUES ('99', '2', '5', '2008-11-06 23:37:56');");
      // Add columns
      // End of custom transaction instance

      // Execute all the registered transactions
      $tNGs->executeTransactions();