I'm trying to insert data into my database using php prepared statements. Problem is, this error keeps showing up.
Fatal error: Uncaught Error: Call to a member function bind_param() on bool
There's nothing wrong with my connection to the database. Seeing as it's recognizing my query as a bool, I know here's an error somewhere, but I don't know what exactly it is.
Here's the code for reference :
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$message = $_POST['message'];
$query = $connect -> prepare("INSERT INTO userinfo (nickname,secret) VALUES(?.?)");
$query -> bind_param('ss',$name,$message);
if ($query->execute) {
echo "~Your secret has been SPILLED.";
} else{
echo "~There was an error submitting your secret!";
}
}else{
echo"Error, slippery button syndrom";
}