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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

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

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
Post Reply