不支持,必须一次一次执行
$formatid = mysql_insert_id();
$count = count($_POST['FieldSeq']);
for($tmp=0;$tmp<$count;$tmp++)
{
$subSQL= “INSERT INTO tblAddrFormatDtl SET “;
$subSQL.=”FormatID=”.$formatid.”,”;
$subSQL.=”FieldSeq=”.$_POST['FieldSeq'][$tmp].”,”;
$subSQL.=”FieldName=’”.$_POST['FieldName'][$tmp].”‘,”;
$subSQL.=”OutputSeq=”.$_POST['OutputSeq'][$tmp].”,”;
$subSQL.=”ParentField=’”.$_POST['ParentField'][$tmp].”‘,”;;
$subSQL.=”ListCode=’”.$_POST['ListCode'][$tmp].”‘,”;
$subSQL.=”EntryFlag=”.$_POST['EntryFlag'][$tmp].”,”;
$subSQL.=”NewLine=”.$_POST['NewLine'][$tmp].”;”;
mysql_query($subSQL);
}
insert 不是支持一个insert 插入多条记录么?把语法构建成
INSERT tbl_name (col_name,…)
VALUES ( value,…),(…),…
就好了。
对,这样是可以的!phpmyadmin导出的数据也是这个格式的。
谁说不知道多个语句的
注意看文档阿
http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html