SQLSTATE [HY093]:参数号无效:未定
// BUILD VALUES
$count = count($matches);
for($i = 0; $i < $count; ++$i) {
$values[] = '(?)';
}
// INSERT INTO DATABASE
$q = $this -> dbc -> prepare("INSERT INTO hashes (hash) VALUES " . implode(', ', $values) . " ON DUPLICATE KEY UPDATE hash = hash");
$q -> execute($matches);
上面的代码失败,出现以下错误
SQLSTATE [HY093]:参数号无效:未定义参数
虽然count($matches) == count($values)在执行之前就被调用了?
这里发生了什么?
MM们