Basic view on the generated code

This is how generated code looks like, considering the Insert Transaction settings:

<?php
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');

// Make an unified connection instance
$conn_test = new tNG_connection($test, $database_ test);

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");

// Make an insert transaction instance
$insertTNG1 = new tNG_insert($conn_test);
$tNGs->addTransaction($insertTNG1);

// Register triggers
$insertTNG1->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "MM_Insert");
$insertTNG1->registerTrigger("END", "Trigger_Default_Redirect", 99, "index.php");

// Add columns
$insertTNG1->setTable("departments_dep");
$insertTNG1->addColumn("id_dep", "NUMERIC_TYPE", "POST", "id", "1");
$insertTNG1->addColumn("name_dep", "STRING_TYPE", "POST", "name", "");
$insertTNG1->setPrimaryKey("id_dep", "NUMERIC_TYPE");

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

// Get the transaction recordset
$rsDepartments_dep = $tNGs->getRecordset("departments_dep");
$row_rsDepartments_dep = mysql_fetch_assoc($rsDepartments_dep );
$totalRows_rsDepartments_dep = mysql_num_rows($rsDepartments_dep );

 

For detailed information regarding the different code parts, read the Extended view on the generated code section.