用php编写的语句,带有mysql\u bind\u parameters语句

omvjsjqw  于 2021-06-15  发布在  Mysql
关注(0)|答案(0)|浏览(159)

我试图让准备好的语句工作,但我得到同样的错误。它说我试图在需要mysql\u stmt的地方使用一个布尔值。

if ($_SERVER['REQUEST_METHOD']=='POST') 
{
 {
   require('zzzx.php') ;
   $quer = 'insert into bloggert (message,email,date) values  (?,?,now()) ';
   $stmt=  mysqli_prepare($conn,$quer);
   mysqli_stmt_bind_param($stmt,'ss',$email,$message);
   //  this is where the errors start.  It always ways says it is getting a 
   // boolean rather than a mysql statement which is required
   $message= nl2br(strip_tags  ($_POST['message']));
   $auathor = strip_tags($_POST['email']);

   mysqli_stmt_execute($stmt);

   if (mysqli_stmt_affected_rows($stmt)==1)
   {
      echo '<p> the review made it to posting</p>';
   }
   else
   {
      echo '<p style = "font-weight:bold; color:#c00;"> It failed utterly.</p>';
      //this, needless to say is what I got with ever reiteration
      echo '<p>'.mysqli_stmt_error($stmt).'   </p>' ;
   }
   mysqli_stmt_close($stmt);
   mysqli_close($conn);
 }
}

问题是,我把它从另一个文件上复制了下来,没问题。
另外,我注意到其他人正在使用不同的分配方式。那会是我问题的根源吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题