Hi iam trying to fetch all the records from database but it is displaying only one record if there are more than 5 records also.I have tried with executing query in database it is working correctly can anyone help me regarding this. If i delete the records and if there is no records in database it is displaying the delete option as well as the image option in front end. Here is my code.
image.php
<?php
$connection = mysql_connect("localhost", "root", "") or die(mysql_error());
$db = mysql_select_db("accountant", $connection);
$res = "SELECT * FROM blogs ";
$result=mysql_query($res);
$row = mysql_fetch_array($result);
?>
blogimage.php
<form method="post" action="image.php" id="myform">
<table>
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Image</th>
<th scope="col" style="width: 65px;">Modify</th>
</tr>
</thead>
<tbody>
<?php include "image.php" ;?>
<tr>
<td><?php echo $row['blog_title'];?></td>
<td><img src="upload/<?php echo $row['image'];?>" height="100" width="100"/></td>
<td><a class="buttons delete" href="deleteblog.php" onclick="return confirm('Are you sure to delete');" class="table-icon delete" >Delete Blog</a></td>
</tr>
</tbody>
</table>
</form>
deleteblog.php
$id=$_GET['blog_id'];
$res = "DELETE
FROM blogs
WHERE blog_id=$id";
if($res)
{
echo "successfully deleted";
}
else{
echo "Failure";
}