为什么绑定到无效类型的参数时,我没有收到错误?例如:
$mysqli = new mysqli(HOST, USERNAME, PASSWORD, SCHEMA);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli->connect_error;
}
$stmt = $mysqli->prepare("update app_site_group set name_eng=?, name_fra=? where app_site_group_id=?");
$one = "one";
$two = "two";
$three = "a";
$stmt->bind_param('ssi',$one,$two,$three);
$stmt->execute();
当需要整数时,第三个参数作为字符串传递。它不会引发错误(除了受影响的 0 行)。