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

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.

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann