我正在尝试将数据库布尔值(tinyint)更新为 1,但相反,它正在更新为 NULL,并且所有其他值都在正确更改。
当我离开它时得到的错误如下:
绑定失败:0 执行失败:2031 未为准备好的语句中的参数提供数据
如果我改变 $dealt_Out = 1; 对于一个变量,在准备好的语句之前,所有值都被正确更改,除了布尔值,它最终为 NULL。
<?php
if(!($stmt = $mysqli->prepare("UPDATE card SET player_Holding = ?, dealt_Out = 1 WHERE id_Card = ?"))){
echo "Prepare failed: " . $stmt->errno . " " . $stmt->error;
}
if(!($stmt->bind_param("iii",$_POST['player_Holding'],$_POST['dealt_Out'],$_POST['id_Card']))){
echo "Bind failed: " . $stmt->errno . " " . $stmt->error;
}
if(!$stmt->execute()){
echo "Execute failed: " . $stmt->errno . " " . $stmt->error;
} else {
echo "Edit " . $stmt->affected_rows . " row to Card Holder. <br/><br/><strong>Returning to 'Make a Move'</strong>";
}
?>