Announcement

Collapse
No announcement yet.

Error en sc_commit_trans

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!!

  • #2
    Originally posted by gorini View Post
    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!!
    What is in your variable $Tock ?
    I think you will do a:
    srand(mktime());
    $Tock = srand();

    Comment


    • #3
      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.
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development
      www.scriptcase.eu / www.scriptcase.nl

      Comment

      Working...
      X