2015-10-22 17:48
浏览 7

PHP Mysql查询插入

I have a table - 'A' which has primary key - id which is auto incremented.I also have a table - 'B' which also has the column 'id'. Now I want to add entries to the table A so that value of id attribute of table 'A' which just got inserted to the table also gets inserted to B while other attributes of B can remain NULL.I know I can just make one table with all the columns but is there a way to do this with two tables??

图片转代码服务由CSDN问答提供 功能建议

我有一个表 - 'A'有主键 - id是自动递增的。我也有一个表 - 'B'也有列'id'。 现在我想向表A添加条目,以便刚刚插入表中的表'A'的id属性值也插入到B中,而B的其他属性可以保持为NULL。我知道我只能创建一个表 与所有列,但有两种方法吗?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题