我正在尝试使用prepared准备在一个查询中插入多个记录 声明,但它不会插入,它显示没有错误。任何帮助将不胜感激。感谢
$t7 = ['2','36'];
$t7len = count($t7);
for ($p=0; $p < $t7len; ++$p) {
$clause[] = '('.implode(',', array_fill(0, 4, '?')).')';
}
for($f=0; $f < $t7len; ++$f){
$types[] = 'ii'.str_repeat('i', $t7len);
}
for($k=0; $k < $t7len; ++$k){
$vals[] = '0'.','.'0'.','.'0'.','.$t7[$k];
}
$sql = 'INSERT INTO subject_req(subID,nspID,subCo,subPre) VALUES
'.implode(',', $clause).';';
$stmt = $this->con->prepare($sql);
$stmt->bind_param(implode('', $types), implode(',', $vals));
$stmt->execute();
$stmt->close();