Sunday, 16 April 2017

php - Call to a member function bind_param() on boolean

I try to bind parameters to sql (mysqli) in php, but there is an error code as written above.
This is the code I wrote:



$stmt = $conn->prepare("INSERT INTO assignments (Classes_has_Subjects_classesHasSubjectsId, assignmentName, gradeForAssignment,protectiveGrade) 
VALUES (?, ?, ?, ?)");
if ($stmt = false)

{
echo "false";
}
else{
$stmt->bind_param("sss", $classesHasSubjectsId, $assignmentName, $gradeForAssignment, $protectiveGrade);
$stmt->execute();
}


and here is the error message:

11




Fatal error: Call to a member function bind_param() on boolean in




What's wrong?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...