mysql - Using PHP, MySQLi and Prepared Statement, how I return the id of the inserted row? -
i want retrieve id of inserted row in database, don't know how this.
i tried return using sql clause returning id
, not works.
how can return id after insertion of row?
after calling execute()
method on preparedstatement
, id of insert row in insert_id
attribute. read it.
$pstm->execute(); $pstm->insert_id;
Comments
Post a Comment