-1
我有以下代码工作正常, 但我需要一种批量处理它的方法和 一次插入它。批量插入
for($i=0; $i<sizeof($my_array); $i++)
{
$sql = "INSERT INTO exclude_resource (id,resource_id,config_id)
VALUES(DEFAULT, '$my_array[$i]' ,'$insert_id')";
$command = $connection->createCommand($sql);
$result = $command->execute();
}
多查询帮助你。 : - http://php.net/manual/en/mysqli.multi-query.php –
提高你的问题的标题,它可能会吸引downvoters。 – Sandeep