I have a (headerless) custom-file, in which I (among a lot of other things) write a record into a database table which has an ID field with auto_increment set.
In PHPMaker 2023 the following code worked:
ExecuteStatement("INSERT INTO files (file_name,file_Header_ID, file_IBAN, file_content) VALUES ('" . $bookings["Filename"] . "','" . $bookings["ID"] . "', '" . $bookings["IBAN"] . "', '" . $file_content . "')");
$file_id = ExecuteScalar("SELECT LAST_INSERT_ID();");
In PHPMaker 2024 $file_id
is always 0 instead of the used ID.
How do I query the last inserted ID from MySQL?
Thanks for any help!