I have a table that of course has a unique id for each entry.
How can I retrieve that id when I do a simple insert using this query string:
"INSERT INTO lion_is_foob (id_user, title, url, domain, tag, favicon) VALUES (?, ?, ?, ?, ?, ?)"
The column name is called id
for the auto increment.
Because an insert so commonly creates an auto ID can I retrieve this at the same time.
Answer
Look at http://php.net/mysql_insert_id or http://php.net/mysqli_insert_id (depending on which set of MySQL functions you're using).
No comments:
Post a Comment