【问题标题】:Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement警告:mysqli_stmt::bind_param():变量数与准备语句中的参数数不匹配
【发布时间】:2017-07-19 02:02:56
【问题描述】:

我不知道为什么会这样,我不断收到这个错误警告:

mysqli_stmt::bind_param(): 变量的数量与准备好的语句中的参数数量不匹配

$stmt = $conn->prepare("SELECT clicks FROM affiliate WHERE ID ='$ID'");
$stmt->bind_param("i", $ID);
$stmt->execute();
$stmt->bind_result($clicks); // Store the result in the $clicks variable

【问题讨论】:

标签: php mysql mysqli prepared-statement


【解决方案1】:

将查询中的'$ID' 替换为?。问号用于标记需要绑定的变量。

【讨论】:

  • @Enstage 致命错误:未捕获错误:无法通过引用传递参数 2
猜你喜欢
  • 1970-01-01
  • 2016-10-08
  • 2015-05-17
  • 2013-05-27
  • 2016-07-19
  • 2015-12-30
  • 2018-08-12
  • 2023-03-27
  • 1970-01-01
相关资源
最近更新 更多