【问题标题】:What does bind_param() do?bind_param() 有什么作用?
【发布时间】:2012-06-08 03:11:32
【问题描述】:
$resultSpendStmt = $connection->prepare(...);
$array->bind_param("sdidi", $A, $B, $C, $D, $E);
$array->execute();
$array->store_result();
$array->bind_result($F, $G, $H, $I, $J, $K);

我仍然有点不确定 bind_param 是做什么的。谁能给我一个例子来说明什么是手段?

【问题讨论】:

    标签: php mysqli prepared-statement bindparam


    【解决方案1】:

    当您准备一条 SQL 语句时,您可以在列值所在的位置插入一个占位符 (?),然后使用 bind_param()安全地将该占位符替换为实际列的值。这可以防止任何 SQL 注入的可能性。

    You can read more about bind_param() here.

    【讨论】:

      猜你喜欢
      • 2013-08-27
      • 2013-09-13
      • 2016-03-03
      • 2013-07-31
      • 1970-01-01
      • 2023-04-10
      • 2011-07-17
      • 2014-09-13
      • 2011-12-30
      相关资源
      最近更新 更多