I’ve been trying several methods to get the primary key after an insert is done to a table. The primary key is autoincrement on the database.
I’ve reviewed several other posts and it seems this may be a bug again! Looks like it was fixed but now I’m not sure.
Try #1:
in the onafterinsert event:
sc_commit();
$new_value = mysql_insert_id();
When I display $new_value it is zero.
Try #2:
in the onafterinsert event:
$new_value = mysql_insert_id();
When I display the $new_value it is zero.
It looks like this may have been fixed before but it doesn’t seem to work. Am I just not doing it right?