You are here: insert_id & Stored Procedures « All PHP « IT news, forums, messages
insert_id & Stored Procedures

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация