【发布时间】:2011-10-19 10:15:37
【问题描述】:
我目前正在使用 MySQL。我有一个表,它有一个 auto_increment 'id' 字段和一个 'imgname' 字段,其中包含一个作为图像文件名的字符串。
我需要使用由 INSERT INTO 语句创建的 auto_increment 值生成“imgname”值。问题是,我不知道这个值,直到我可以使用 mysql_insert_id,在插入查询运行之后。我想知道是否可以在插入查询期间以某种方式访问此值,然后使用它在查询语句中生成我的字符串。
提前致谢。
【问题讨论】:
标签: mysql sql database auto-increment insert-into