if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 20;
$from = (($page * $max_results) - $max_results);
?>
Latest Ads
$rateqry="SELECT * FROM yellow_agents,yellow_categories,yellow_posts WHERE yellow_posts.CategoryID=yellow_categories.CategoryID and yellow_posts.AgentID=yellow_agents.AgentID order by yellow_posts.PostDate desc LIMIT $from, $max_results";
$rateq=mysql_query($rateqry)or die($rateqry);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM yellow_posts"),0);
$total_pages = ceil($total_results / $max_results)
?>
Title |
City |
Added |
Price |
while($rateline=mysql_fetch_array($rateq))
{
$rateqry2="SELECT *,avg(rated) AS abcde FROM yellow_rating, yellow_agents,yellow_posts WHERE yellow_rating.mediaid='$rateline[PostID]' and yellow_rating.mediaid=yellow_posts.PostID and yellow_posts.AgentID=yellow_agents.AgentID and regtype='1' GROUP BY yellow_rating.mediaid";
$rateq2=mysql_query($rateqry2)or die($rateqry2.mysql_error());
$rateline2=mysql_fetch_array($rateq2);
$ShortDesc = substr($rateline[resume], 0, 100);
$q123 = "select * from yellow_subcat where subcatid = '$rateline[SubCategoryID]' ";
$r123 = mysql_query($q123) or die(mysql_error());
$a123 = mysql_fetch_array($r123);
if ($rateline[City]=="")
{
$cityname =$rateline[city];
}
else
{
$cityname =$rateline[City];
}
?>
|
=$cityname;?> |
=date('m-d-y',$rateline[PostDate]);?> |
Rs. =$rateline[Price]?> |
}?>
echo paginate($total_results, $max_results, 10, $page, Previous, Next, First, Last,$linkspaginate, false);
?>