将多个参数绑定到mysqli查询中
if ($words_total == 1) { $statement -> bind_param("s", $words[0]); } else if ($words_total == 2) { $statement -> bind_param("ss", $words[0], $words[1]); } else if ($words_total == 3) { $statement -> bind_param("sss", $words[0], $words[1], $words[2]); } //and so on....
$marks = ""; for($i = 1; $i<=$words_total; $i++) { if ($i == $words_total) { $marks .= "?"; } else { $marks .= "?,"; } }
隔江千里