[英]php insert mysql_query get id
In PHP 4, how can I easily get the last id
after an insert
in db? 在PHP 4中,如何在db中
insert
后轻松获得最后一个id
? For example: 例如:
$queryInsert = "INSERT INTO `table` (`id`, `info`) VALUES (NULL, '".$INFO_VAR."');";
mysql_query($queryInsert) or die (mysql_error());
use mysql_insert_id();
使用
mysql_insert_id();
, you find the doc here ,您可以在此处找到文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.