大神 求救 mysql 插入新数据返回最后插入的用户ID无效
java吧
全部回复
仅看楼主
level 5
贴上代码,代码中LAST_INSERT_ID() 没起到作用



select LAST_INSERT_ID()

insert into
youth_userinfo(userinfo_id,userinfo_phone,userinfo_pwd,userinfo_registerdate)
values (
#{userinfo_id},#
{userinfo_phone},
#{userinfo_pwd},#
{userinfo_registerdate})

2016年04月06日 06点04分 1
level 14
[飘过][飘过]
2016年04月06日 06点04分 2
level 14
贴吧雷锋在此,帮顶不用谢。叫我雷洪。
2016年04月06日 06点04分 3
level 9
都是水军
2016年04月06日 06点04分 4
level 11
只需要在<insert>标签上加上 useGeneratedKeys="true", keyProperty="id"这个是主键的name对应你实体bean的id就可以了
2016年04月06日 06点04分 5
level 14
贴吧雷锋在此,帮顶不用谢。叫我雷洪。
2016年04月06日 07点04分 8
1