I am trying to get prepared statements to work, but I get the same error. It says I am trying to use a Boolean where a mysql_stmt is required.
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);
}
}
The thing is, I copied it off another file that does work, no problem.
Also, I notice other folks are using a different way of assigning. Would that be the source of my problem?