0

I give a image display PHP code in a page while i am not insert images in a database i had occur this error called

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in E:\wamp\www\Demo 22\gallery.php on line 404?

And this is code:

<?php
include("includes/connect.php");

$select_posts = "select * from album1 where post_id=1";

$run_posts = mysqli_query($con,$select_posts);


while($row=mysqli_fetch_array($run_posts)){

   $post_title = $row['post_title'];
   $post_name =  $row['post_name'];
   $post_image = $row['post_image'];`enter code here`
?>

<p><?php echo $post_title; ?></p>
<a href="gallery1.php"><img class="gallery1" src="image/album1/<?php echo $post_image; ?>"width="160" height="120" ></a>
<p><?php echo $post_name; ?></p>

<?php } ?>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Balaji
  • 9
  • 3

1 Answers1

-1

This means your previous call to mysqli_query returned false instead of reference to result set. This happens when there is syntax error in the SQL. Try running the SQL manually or report the error by calling echo mysqli_error($con).

Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43