Hi,
I am having problems with an AfterAdd() which I wrote:
function AfterAdd(&$values)
{
//** Insert a record into another table ****
global $conn;
$strSQLInsert = "insert into itemtransaction (date, transaction_id, customer_id) values ('".date('g:i:sA 1 j/m/Y')."',
'".$values['transaction_id']."', '".$values['customer_id']."')";
db_exec($strSQLInsert,$conn);
}
inside the php file that runs this function, I added the parameter like this:
AfterAdd($avalues);
This actually works and adds something into the table itemtransaction but everything is empty. Why is this so? The structure of itemtransaction looks like this:
item_id(INT)
date
transaction_id
customer_id
supplier_id
item_id is suppose to be auto-incremented, how can I do this? like evertime I try to add something, it will add one to the last entry.