相思资源网 Design By www.200059.com

如下所示:

<"insert intov9_admin_role_priv(roleid, m, c, a, `data`, siteid) values (12, 'huiben','huiben', 'hbprop_add', '', 1)";
$res = mysql_query($query, $dbh);
//"获取刚才插入的id,表需要设置主键自增"
echo "ID of last inserted record is: " .mysql_insert_id();
$query = "select max(roleid) fromv9_admin_role_priv";
$res = mysql_query($query, $dbh);
$err = mysql_error();
if($err){
  echo "发生错误,请通知管理员";
}
$row = mysql_fetch_row($res);
echo "未来您使用的号码为:".$row[0];
"color: #ff0000">匹克系统应用:

 $query = " INSERT INTOpkbk.v9_member (phpssouid, username, password, encrypt, nickname, regdate,lastdate, regip, lastip, loginnum, biaoshi, planid, email, groupid, areaid,amount, point, modelid, message, islock, vip, overduedate, siteid, connectid,`from`, mobile, yey, yeybj, sleeptime, waketime, cardno, zentime, zencount,is_js, bsount)".
"VALUES (1, 'lbg','9f575f22246a1a5fb38e1846bb0ec964', 'pTseba', '', 1384397338, 1403544894,'221.199.6.231', '118.112.20.103', 0, '', 0, 'nxnet123@qq.com', 2, 0, 0, 0, 10,0, 0, 0, 0, 1, 'A74EECDFA5A22C81C05ED49E7CF9224D', 'qq', '', '', '', 0, 0, '',0, 0, 0, 0)";
    $number=$mydb->sql_query($query);
    echo "ID of last inserted recordis: ".mysql_insert_id();

以上这篇php插入mysql数据返回id的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

标签:
php,mysql,id

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“php插入mysql数据返回id的方法”

暂无php插入mysql数据返回id的方法的评论...