All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP取得当前插入数据库中记录的id值_php资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/21 22:25:21 Browse times: 400 Comment times: 0

PHP取得当前插入数据库中记录的id值_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

PHP取得当前插入数据库中记录的id值_php资料_编程技术-你的首页-uuhomepage.com

在PHP中,经常需要把插入数据库中的id值取出来,而正好有这么一个函数:

//执行插入数据库的语句
//……
$getID=mysql_insert_id();//$getID即为最后一条记录的ID
?>

PHP 函数 mysql_insert_id() 是返回在最后一次执行了 INSERT 查询后,由 AUTO_INCREMENT 定义的字段的值。





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.