所以,起初我加入了很多表,并使用了别名,但我将其简化为以下符号,它给了我这个错误。
警告:mysqli_stmt::bind_param():变量的数量与准备好的语句中的参数数量不匹配
$sql = "SELECT table.name FROM `table`";
if (!($stmt = $link->prepare($sql))) {
echo "Prepare failed: (" . $link->errno . ") " . $link->error;
die();
}
if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error."<br/>";
die();
}
if (!$stmt->bind_param("s", $country)) {
echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
die();
}
如果我尝试table.name
用刻度换行,则会收到此错误:
Prepare failed: (1054) Unknown column 'venues.name' in 'field list'