Error en sc_commit_trans

I am new to ScriptCase, I need help!

In a form with a button run the following PHP method

sc_begin_trans(“conn_semaforo”);
srand(mktime());
$Tock = rand();
$sql_Semaforo = “INSERT INTO PF900 (ID,TOCK) VALUES(NULL,’”.$Tock."’)";
sc_exec_sql($sql_Semaforo,“conn_semaforo”);
sc_commit_trans(“conn_semaforo”);

That gives me the following error

Error
Undefined property: form_PF052_ini::$nm_bases_access
in_array() expects parameter 2 to be array, null given

I will appreciate help!!

[QUOTE=gorini;16033]I am new to ScriptCase, I need help!

In a form with a button run the following PHP method

sc_begin_trans(“conn_semaforo”);
srand(mktime());
$Tock = rand();
$sql_Semaforo = “INSERT INTO PF900 (ID,TOCK) VALUES(NULL,’”.$Tock."’)";
sc_exec_sql($sql_Semaforo,“conn_semaforo”);
sc_commit_trans(“conn_semaforo”);

That gives me the following error

Error
Undefined property: form_PF052_ini::$nm_bases_access
in_array() expects parameter 2 to be array, null given

I will appreciate help!![/QUOTE]

What is in your variable $Tock ?
I think you will do a:
srand(mktime());
$Tock = srand();

If you are using an autosequence you might try to remove the id/null. Depending on your settings it might be possible that you are using a nested transaction. If the connection is the same as that of the application the name of the connection is not necessary. As this is only one insert without dependencies I think you can omit the transaction.

Just a hand-full of options I’m affraid. But I hope one of them will solve your issue.