我可以使用从mysql_query获取刚刚插入的表行id吗? [重复]

时间:2022-09-25 21:24:09

Possible Duplicate:
PHP: how to get last inserted ID of a table?

可能重复:PHP:如何获取表的最后插入ID?

I use mysql_query() in PHP to insert a new record in my Database.

我在PHP中使用mysql_query()在我的数据库中插入一条新记录。

It will auto generate a row, with a user Id, can I use the result to get that Id?

它将自动生成一行,用户ID,我可以使用结果来获取该ID吗?

1 个解决方案

#1


3  

mysql_insert_id()

Have you considered upgrading to PDO?

您是否考虑过升级到PDO?

#1


3  

mysql_insert_id()

Have you considered upgrading to PDO?

您是否考虑过升级到PDO?