Page 1 of 1

how do i add a rank bij a b c d e f and on?

Posted: Sat Jun 21, 2003 4:45 pm
by GK
Hi all

withtin this page i also want to make links
a b c d e f g and on when they click it it got to sort on it

How do i do this?

Code: Select all

if (!$cid) {$cid = 0;}
if (!$from) {$from = 0;}

if ($cid == 0) {
	$squery = mysql_query ("select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step") or die (mysql_error());
	$tquery = mysql_db_query ($dbname,"select count(sid) as total from top_user where status='Y'",$db) or die (mysql_error());
}
else {
	$squery = mysql_db_query ($dbname,"select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits and category=$cid order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step",$db) or die (mysql_error());
	$tquery = mysql_db_query ($dbname,"select count(sid) as total from top_user where status='Y' and category=$cid",$db) or die (mysql_error());
}
mod_edit: added

Code: Select all

tags[/size]

All old stuff should stay working
i just need to add a new funtion

Can someone help me?

Posted: Sat Jun 21, 2003 7:51 pm
by volka
order by thin DESC,ranks DESC,star DESC,thout DESC
this part of your query string has to be changed depending on which column has been pressed