php - Storing Auto-Incremented ID when using PDO for MySQL -
i'm using pdo mysql. i'm inserting table has id field set autoincrement. i'd store value reuse in next line. how can this?
from php manual:
returns id of last inserted row, or last value sequence object, depending on underlying driver. example, pdo_pgsql requires specify name of sequence object name parameter.
return $db->lastinsertid('youridcolumn');
Comments
Post a Comment