Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我做了一个 MySQL 插入语句,比如说:
"INSERT into tablename (column1, column2, column3) VALUES ("blah", "blahblah", "blahblahblah");
无论如何都知道创建了什么行?就像,假设有一个 column4 我用作主要的自动递增键,我想知道哪个是最近提交的值。如果不再次查询数据库,这可能吗?
尝试使用此处找到的 mysql_insert_id():
http://php.net/manual/en/function.mysql-insert-id.php