且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择最后一个插入ID

更新时间:2023-01-08 16:24:13

签出 mysql_insert_id() >

mysql_query($sql);
$id = mysql_insert_id();

在mysql_query()命令中执行INSERT语句后运行该函数时,其结果将是刚创建的行的ID.

When that function is run after you've executed your INSERT statement in a mysql_query() command its result will be the ID of the row that was just created.