<?php
if(!isset($_GET['carto']))
{
/*$query='SELECT name, views, categories,descr,title,id, height,width,size,
@country_rank := IF(@current_country = categories, @country_rank + 1, 1) AS country_rank,
@current_country := categories
FROM wallpaper_tb
ORDER BY categories, views DESC';*/
$tmp='';
$rr=mysql_query("SELECT * from categories");
while($row=mysql_fetch_array($rr))
{
$bb=$row['catog_name'];
//echo $bb;
if (!$tmp)
{
$tmp = "( SELECT * FROM wallpaper_tb WHERE categories='".$bb;
}
else
{
$tmp .= "' order by views desc limit 10) union all ( SELECT * FROM wallpaper_tb WHERE categories='" . $bb;
}
}
//echo $tmp."' order by views desc limit 10 )";
$val= $tmp."' order by views desc limit 10 )";
?>
if(!isset($_GET['carto']))
{
/*$query='SELECT name, views, categories,descr,title,id, height,width,size,
@country_rank := IF(@current_country = categories, @country_rank + 1, 1) AS country_rank,
@current_country := categories
FROM wallpaper_tb
ORDER BY categories, views DESC';*/
$tmp='';
$rr=mysql_query("SELECT * from categories");
while($row=mysql_fetch_array($rr))
{
$bb=$row['catog_name'];
//echo $bb;
if (!$tmp)
{
$tmp = "( SELECT * FROM wallpaper_tb WHERE categories='".$bb;
}
else
{
$tmp .= "' order by views desc limit 10) union all ( SELECT * FROM wallpaper_tb WHERE categories='" . $bb;
}
}
//echo $tmp."' order by views desc limit 10 )";
$val= $tmp."' order by views desc limit 10 )";
?>
No comments:
Post a Comment
Dharamart.blogspot.in