display different image in same div in php -
i want display first image,title , description in col1 div, second in col3 , on in first image repeat in div . how solve this
<?php include('connection.php'); $perpage=1; $i=1; if(isset($_request['act']) && trim($_request['act']=='load_data')){ $page=1; if(!empty($_get["page"])) { $page = $_get["page"]; } $start = ($page-1)*$perpage; if($start < 0) $start = 0; $msg=''; $q="select * addimages order id desc limit $start,$perpage "; $res = mysql_query($q); $row = mysql_fetch_array($res); $id = $row['art_id']; $qe="select banner images id=$id"; $rs=mysql_query($qe); $name=mysql_fetch_array($rs); //$id=$row['id']; //$no=mysql_num_rows($res); if(!$row==""){ $msg .= "<div class='article_index' id='".$row["art_id"]."'><div class='article banner_add'><a href='#'><img height='220' src='./uploads/" . $name['banner'] . "' /></a></div>"; $msg .=" <div class='post_main' > <div class='col1'> <div class='post_img'><a href='#'><img class='lazy' data-original='./uploads/" . $row['image'] . "' width='633' height='441' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title'><h2><a href='#'>".$row['title']."</a></h2></div> <div class='post_contant'>".$row['desc']."</div> </div> </div>"; $msg .=" <div class='col3'> <div class='post_img'><a href='#'><img class='lazy' width='299' height='191' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title post_rtitle'><h2><a href='#'>".$row['title']."</a></h2></div> </div> </div> <div class='col3'> <div class='post_img'><a href='#'><img class='lazy' width='299' height='191' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title post_rtitle'><h2><a href='#'>".$row['title']."</a></h2></div> </div> </div> <div class='col2'> <div class='post_img'><a href='#'><img class='lazy' width='461' height='300' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title'><h2><a href='#'>".$row['title']."</a></h2></div> <div class='post_contant'>".$row['desc']."</div> </div> </div> <div class='col2'> <div class='post_img'><a href='#'><img class='lazy' width='461' height='300' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title'><h2><a href='#'>".$row['title']."</a></h2></div> <div class='post_contant'>".$row['desc']."</div> </div> </div> </div> </div> "; } $msg .="<a class='next' href='#'></a> <input type='hidden' id='pageno' name='pageno' value=''>"; echo $msg; } ?>
i want increase row array next id , display content using infinite scroll plugin
you fetch 1 top row. if want rows, need loop thought.
while ($row = $result->fetch_row()) { $msg .=" <div class='post_main' > <div class='col1'> <div class='post_img'><a href='#'><img class='lazy' data-original='./uploads/" . $row['image'] . "' width='633' height='441' src='./uploads/" . $row['image'] . "' style='display: inline;' /></a> </div> <div class='post_contant_main'> <div class='post_title'><h2><a href='#'>".$row['title']."</a></h2></div> <div class='post_contant'>".$row['desc']."</div> </div> </div>"; }
Comments
Post a Comment