I have the following error: "Trying to get property of non-object on line 22" in the following code:
<?php
require('config.php');
if (isset($_POST['email']))
{
$email = stripslashes($_REQUEST['email']);
$email = mysqli_real_escape_string($conn,$email);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($conn,$password);
$stmt = $conn->prepare("SELECT password FROM registo WHERE email=?");
$stmt->bind_param("s",$email);
$email = $_POST['email'];
$stmt->execute();
$result= $stmt->store_result();
if($stmt->affected_rows > 0)
{
$user = mysqli_stmt_bind_result($stmt, $pass);
if(password_verify($password,$pass))
{
$_SESSION['email'] = $email;
$_SESSION['user'] = true;
header("Location: home.php");
Same error:
<?php while($books =mysqli_stmt_fetch($stmt)){?>
<?php $id = $id +1;?>
<tr>
<td><?php echo '<img src="data:image/jpeg;base64,'.base64_encode( $books->Image).'"height="100" width="100">'; ?> </td> //linha 92
I have tried several ways and I can not solve it.