多个INSERT INTO多个表

时间:2013-12-28 04:49:26

标签: mysql

以下是我的代码。它只会输出researchresearch_authored_by,而不会输出中间编码的research_attachments。我该如何解决这个问题?

mysql_connect("localhost", "root", "");
mysql_select_db("research_db");
mysql_query("INSERT INTO research(researchid, title, classification, type, copies, location, topic) 
VALUES ('$_POST[researchid]','$_POST[title]','$_POST[classification]','$_POST[type]','$_POST[copies]','$_POST[location]','$_POST[topic]')");
mysql_query("INSERT INTO research_attachments(researchid, title, attachmenttype, attachmentcopies, attachmentlocation) 
VALUES ('$_POST[researchid]','$_POST[title]','$_POST[attachmenttype]','$_POST[attachmentcopies]','$_POST[attachmentlocation]')");
mysql_query("INSERT INTO research_authored_by(researchid, title, personid, lastname, firstname, monthsubmitted, datesubmitted, yearsubmitted) 
VALUES ('$_POST[researchid]','$_POST[title]','$_POST[personid]','$_POST[lastname]','$_POST[firstname]','$_POST[monthsubmitted]','$_POST[datesubmitted]','$_POST[yearsubmitted]')");

0 个答案:

没有答案