1
In my code I perform two insertions using the Adodb 5 library, with the Mysql driver for PHP.
But at certain times occurs the function Insert_ID()
return an id (primary key) of a Insert previous to the one at the time, the two Inserts work smoothly, this can happen if the second Insert return a timeout, and he can return a timeout?
Sample Code
// Primeiro Insert
$db->Execute("INSERT INTO table_1 VALUES ('1')");
// Pega o primeiro id
$id_1 = $db->Insert_ID();
// Segundo Insert
$db->Execute("INSERT INTO table_2 VALUES ('1')")
// Pega o segundo id inserido
$id_2 = $db->Insert_ID(); /* Em certos momento pega o ID do primeiro Insert */