出于某种原因,我得到了。
Fatal error: Call to a member function bind_param() on boolean in D:\xampp\htdocs\tuitioncentre\stud-editprofile_process.php on line 19
我在其他进程上使用了相同的函数,并且运行良好。我对编程很陌生,有人可以帮助我吗?
提前谢谢您!
<?php
session_start();
$type = $_SESSION['sess_usertype'];
if(!isset($_SESSION['sess_user_id']) || $type!="1"){
header('Location: login.php?err=2');
}
include('db.php');
$data = $conn->prepare("UPDATE student INNER JOIN user ON student.student_nric=user.user_nric SET user_password = ?,
student_name = ?,
student_address = ?,
student_contactNo = ?,
student_fatherName = ?,
student_fatherContactNo = ?
student_motherName = ?,
student_motherContactNo = ?
WHERE student_nric = {$_SESSION['sess_user_id']}");
$data->bind_param('ssssssss',
$_POST['user_password'],
$_POST['student_name'],
$_POST['student_address'],
$_POST['student_contactNo'],
$_POST['student_fatherName'],
$_POST['student_fatherContactNo'],
$_POST['student_motherName'],
$_POST['student_motherContactNo']);
$data->execute();
$data->close();
header("Location: stud-dashboard.php");
?>
最佳答案
根据 MySQLi 文档页面 http://php.net/manual/en/mysqli.prepare.php它指出:
mysqli_prepare() returns a statement object or FALSE if an error occurred.
您的错误表明您正在尝试调用函数 bind_param()
在boolean
上(FALSE)因此您的错误表明您的准备调用中存在错误。
我建议这是由于 student_fatherContactNo = ?
之后缺少逗号造成的.
关于php - (PHP) fatal error : Call to a member function bind_param(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42068062/