1 Reply Latest reply on Sep 18, 2008 9:52 AM by (shane_mosier)

    tNG_insert.executeTransaction - execute sql*

      I'm getting this error, at least that's the line highlighted in red, on my code page.
      Here's what I'm doing:
      1. Login from login.php (a login outside of the ADDT). This sends you to my code page which has the authorization code.
      2. Once you are confirmed as a login, on the same page, I have the Insert Transaction code below.

      Any ideas what could be causing this error? I don't think i have any bad table or field names.

      Thanks!

      Here's my code;

      // Make an insert transaction instance
      $ins_pcph_users_pus = new tNG_insert($conn_admin);
      $tNGs->addTransaction($ins_pcph_users_pus);
      // Register triggers
      $ins_pcph_users_pus->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "VALUE", "1");
      $ins_pcph_users_pus->registerTrigger("END", "Trigger_Default_Redirect", 99, "http://mirror.www.umb.edu/it/pcphonehome/entry.php?id_pus={SESSION.id_pus}");
      $ins_pcph_users_pus->registerTrigger("AFTER", "Trigger_Custom", 50);
      // Add columns
      $ins_pcph_users_pus->setTable("pcph_users_pus");
      $ins_pcph_users_pus->addColumn("fname_pus", "STRING_TYPE", "POST", "fname_pus", "{SESSION.kt_fname_pus}");
      $ins_pcph_users_pus->addColumn("lname_pus", "STRING_TYPE", "POST", "lname_pus", "{SESSION.kt_lname_pus}");
      $ins_pcph_users_pus->addColumn("uname_pus", "STRING_TYPE", "POST", "uname_pus", "{SESSION.kt_login_user}");
      $ins_pcph_users_pus->addColumn("email_pus", "STRING_TYPE", "POST", "email_pus", "{SESSION.kt_login_user}@umb.edu");
      $ins_pcph_users_pus->addColumn("access_pus", "NUMERIC_TYPE", "SESSION", "access_pus", "592");
      $ins_pcph_users_pus->setPrimaryKey("id_pus", "NUMERIC_TYPE");

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

      // Get the transaction recordset
      $rspcph_users_pus = $tNGs->getRecordset("pcph_users_pus");
      $row_rspcph_users_pus = mysql_fetch_assoc($rspcph_users_pus);
      $totalRows_rspcph_users_pus = mysql_num_rows($rspcph_users_pus);

      //echo $_SESSION['kt_login_fname'];
      //echo "229";

      //start Trigger_Custom trigger
      function Trigger_Custom(&$tNG) {
      $_SESSION['id_pus'] = $tNG->getPrimaryKeyValue();
      }
      //end Trigger_Custom trigger

      Also, here's the error code I get:

      ERROR_LABEL
      SQL_ERROR
      Developer Details:
      SQL_ERROR (SQL_ERROR)
      tNG Execution Trace - VIEW
      tNG_insert.executeTransaction
      STARTER.Trigger_Default_Starter
      tNG_insert.doTransaction
      BEFORE.Trigger_Registration_CheckUniqueUsername
      BEFORE.Trigger_Registration_CheckPassword
      BEFORE.Trigger_Registration_EncryptPassword
      BEFORE.Trigger_Registration_PrepareActivation
      tNG_insert.prepareSQL
      tNG_insert.executeTransaction - execute sql*
      ERROR.Trigger_Default_Insert_RollBack
      tNG_insert.getRecordset
      tNG_insert.getFakeRsArr
      tNG_insert.getLocalRecordset
      tNG_insert.getFakeRecordset
      tNG_insert.getFakeRecordset
        • 1. Re: tNG_insert.executeTransaction - execute sql*
          Level 1
          Peter,

          I don't think any of these lines will work.

          $ins_pcph_users_pus->addColumn("lname_pus", "STRING_TYPE", "POST", "lname_pus", "{SESSION.kt_lname_pus}");

          Since you are trying to run this code without actually "POST"ing anything.

          Compare this line which uses a session variable for the value(which was set in the wizard):

          $ins_pcph_users_pus->addColumn("access_pus", "NUMERIC_TYPE", "SESSION", "access_pus", "592");

          You're going to have to get the right syntax down for this. I'm not sure what it is, but besides "POST" and "SESSION" you can also use "VALUE" to directly set the value. I'm not sure of the exact syntax for that.

          Shane