update record
update record
hi,
i have an insert form generated by addt which works fine, however i have added an update transaction to this, to be triggered from the insert form submit button.
however it does not update the table:
this is the update code:
// Make an update transaction instance
$upd_clients = new tNG_update($conn_cbank);
$tNGs->addTransaction($upd_clients);
// Register triggers
$upd_clients->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
// Add columns
$upd_clients->setTable("clients");
$upd_clients->addColumn("Status", "STRING_TYPE", "VALUE", "Case");
$upd_clients->setPrimaryKey("ClientID", "NUMERIC_TYPE", "GET", "ClientID");
hope someone can help.
many thanks
i have an insert form generated by addt which works fine, however i have added an update transaction to this, to be triggered from the insert form submit button.
however it does not update the table:
this is the update code:
// Make an update transaction instance
$upd_clients = new tNG_update($conn_cbank);
$tNGs->addTransaction($upd_clients);
// Register triggers
$upd_clients->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
// Add columns
$upd_clients->setTable("clients");
$upd_clients->addColumn("Status", "STRING_TYPE", "VALUE", "Case");
$upd_clients->setPrimaryKey("ClientID", "NUMERIC_TYPE", "GET", "ClientID");
hope someone can help.
many thanks
Re: update record
Hi mrhankey,
try to change KT_Insert1 in KT_Update1.
$upd_clients->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
You also need an update-button in the form named "KT_Update1".
try to change KT_Insert1 in KT_Update1.
$upd_clients->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
You also need an update-button in the form named "KT_Update1".
Re: update record
hi,
thanks for the reply.
sorry it is not an update record it is an insert record got mixed up when posting with what i was working on.
anyway the code i have tried is:
// Register triggers
$ins_cash_sale->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_cash_sale->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_cash_sale->registerTrigger("END", "Trigger_Default_Redirect", 99, $_SERVER['HTTP_REFERER']);
i basically want it to redirect to the previous page the user was on?
thanks again
thanks for the reply.
sorry it is not an update record it is an insert record got mixed up when posting with what i was working on.
anyway the code i have tried is:
// Register triggers
$ins_cash_sale->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_cash_sale->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_cash_sale->registerTrigger("END", "Trigger_Default_Redirect", 99, $_SERVER['HTTP_REFERER']);
i basically want it to redirect to the previous page the user was on?
thanks again
Re: update record
Add this at the top of your referring page and your update page
Then call your update page like this
Code: Select all
// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');
Code: Select all
/admin/transactions_edit.php?KT_back=1
Re: update record
hi fred thanks for all your help mate.
just a quick one, where would i add the call in the update record?
in the addt transaction code or in the form action?
thanks mate
just a quick one, where would i add the call in the update record?
in the addt transaction code or in the form action?
thanks mate
Re: update record
As the last parameter of the form action.