Announcement

Collapse
No announcement yet.

mysql_insert_id not working

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

  • mysql_insert_id not working

    Hello,

    does other developers face the same problem ... ??

    That's what I did.
    in PHP-Button within a grid

    $sql = "INSERT INTO DOZENTEN SET Vorname = 'Alfred'";
    sc_exec_sql ($sql);
    $last_id = mysql_insert_id();

    Last ID is returning 0 ....


    Within a function in a library
    $sql = "INSERT INTO DOZENTEN SET Vorname = 'Alfred'";
    sc_exec_sql ($sql);
    $last_id = mysql_insert_id();

    $last_id return the correct value...


    Best regardfs
    Uwe Pfeiffer

  • #2
    I think it has to do with commit in the transaction. After the transaction is complete the reference to it is gone. So somehow transactions are handled differently in the macro or other spot.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hello,

      Issue reported to our bugs team.

      regards,
      Bernhard Bernsmann

      Comment

      Working...
      X