您好,欢迎访问一九零五行业门户网

PHP操作数据库有关问题

php操作数据库问题
问题:
        有两个表:   table1,table2
        table1里的字段有:
        id     title   content
table2里的字段有:
        id   cid   user
其中cid为table1中的id
table1通过   insert   into   生成一个数据后,同时将table1中的   id   写到table2中,怎么实现啊?
如下:
table1:
id   title       content
1       test         内容
2       test2       内容2
table2:
id   cid       user
1       1         用户
2       2         用户2
谢谢~~
------解决方案--------------------
mysql_insert_id();
取得上一步 insert 操作产生的 id 再插入table2
其它类似信息

推荐信息