在mysqli中输出Inserted.row [英] OUTPUT Inserted.row in mysqli

查看:139
本文介绍了在mysqli中输出Inserted.row的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下sql表:

id | email | fbid

id|email|fbid

我执行查询时

 INSERT INTO users(email,fbid) VALUES('randomvalue','otherrandomvalue')

我想获取插入行的ID.为此,我尝试像这样编辑查询:

I want to get the id of the inserted row. To do so, I've tried to edit the query like this:

 INSERT INTO users(email,fbid) VALUES('randomvalue','otherrandomvalue') OUTPUT Inserted.id

但是我得到了:

1064-您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册以使用正确的语法 在第1行的"OUTPUT Inserted.id"附近

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OUTPUT Inserted.id' at line 1

可能是什么问题?

推荐答案

不幸的是(据我所知)不支持output,因为

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆