|
Posted by McHenry on 09/28/73 11:46
The documentation on PHP & stored procedures is limited so can anyone
confirm that the id value of the last inserted row is available via the
"insert_id" function ?
The table uses an AUTO_INCREMENT constraint for the PK column.
I have a sp that is called from PHP to insert a row into a table, after the
procedure has been executed I can obtain db errors, if any, and the number
of rows affected successfully however the insert_id is always 0, even when a
rows has been inserted ?
$leadid=$mysqli->insert_id; //doesn't work
$error = $mysqli->error; //works !
$affected_rows=$stmt->affected_rows; //works !
Thanks in advance...
Navigation:
[Reply to this message]
|