--- Merlin <[EMAIL PROTECTED]> wrote:
> I am having difficulties to order user into a ranking table. In
> the listing of the users I use a select statement, where I order
> after points and registration date. Then I print out thre results
> counting the rows. 1,2,3...
> 
> SELECT
>       u.user_name,
> FROM
>       usertable
> ORDER BY
>       points desc, registration_date desc
>  
> on another page the user can access his user rank directly. Here
> I am using a count statement where I count all users who have
> more points than the member and have registered earlier (to
> avoid results with members having the same points)
> 
> SELECT count(*) AS c
> FROM
>       usertable
> WHERE
>       points > '$points'
>       AND registration_date > '$date'
> 
> Theoreticly the result number of the first select statement
> should be identical

That's some wacky theory. :-)

I think you need to study what the where clause does. Also, what version
of PHP are you using?

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming December 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to