<?php include("admin/config/db.php"); ?> <div class="col-md-4"> <div class="side"> <div class="side_main"> <span>Latest Post</span></div> </div><br> <?php $select="select * from news order by id Desc limit 0,4"; $run=mysqli_query($con,$select); $count=mysqli_num_rows($run); if(count>0){ while($row=mysqli_fetch_array($run)){ $id=$row['id']; $name=$row['Name']; $img=$row['Image']; ?> <div class="row"> <div class="col-md-4"><br><img src="admin/<?php echo $img?> " class ="img img-rounded" style="width:120px; height:120px; border:1px solid;"><br><br></div> <div class="col-md-4"><span class="side_post"><a href="viewnews.php?id=<?php echo $id?>"><?php echo $name?></a></div> </div></div><hr> <?php}} else{ echo "<center><h5>Sorry No Post Available </h5></center>"; } ?> <div class="col-md-4"> <div class="side"> <div class="side_main"> <span>Categories</span> </div> <div class="cat"> <?php $cat="select * from cat order by id desc"; $run_cat=mysqli_query($con,$cat); $count_cat=mysqli_num_rows($run_cat); if($count_cat>0){ while($row=mysqli_fetch_array($run_cat)){ $id_cat=$row_cat['id']; $name_cat=$row_cat['Name']; ?> <a href="all.php?id=<?php echo $id_cat ?>"><?php echo $name_cat ?> </a> <?php }} else{ echo "<center><h5>Sorry No Categories Available </h5></center>"; } ?> </div>
if(count>0){
/* no issue here; just keeping consistent format is suggested. */ /* */ <?php echo $img?> <?php echo $img;?> /* Alternative */ <?=$img?>
include("admin/config/db.php");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)