错误:Fatal error: Call to a member function bind_param() on boolean in
调用函数出现了Fatal error: Call to a member function bind_param() on boolean in...
函数代码如下:
function inLog($userID,$operType,$content,$function,$filename){
$mysqli = mysqli_connect("localhost","root","password") or die(mysqli_connect_error());
$stmt = $mysqli->prepare("insert into log (userid,type,content,function,filename,builddate) values (?,?,?,?,?,now())");
$stmt->bind_param('issss',$userID1,$operType1,$content1,$function1,$filename1);
$userID1=$userID;
$operType1=$operType;
$content1=$content;
$function1=$function;
$filename1=$filename;
//mysqli_query($con,"insert into log (userid,type,content,function,filename,builddate) values (".$userID.",'".$operType."','".$content."','".$function."','".$filename."',now())") or exit("操作错误");
$stmt->execute();
$stmt->close();
$mysqli->close();
}
请问各位大虾,怎么回事?