I am trying to insert a boolean value into MySql using php. I have the following code:
$query = "insert into credentials values (?, ?, ?, ?, ?, ?, ?)";
$stmt = $db->prepare($query);
$stmt->bind_param("dssssid", $userID, $websiteName, $username, $password, $dateCreated, $currentLogin,
$categoryID);
$stmt->execute();
echo $stmt->affected_rows." Credentials inserted into database";
The value dateCreated is a 1 for true but when I try to use my webpage to enter it i get the following error:
Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in C:\xampp\htdocs\usernamesandpasswords\insertcredentials.php:50 Stack trace: #0 {main} thrown in C:\xampp\htdocs\usernamesandpasswords\insertcredentials.php on line 50
I have tried using it as a string, int and casted (int) to it but I still get the error.