Raised This Month: $51 Target: $400
 12% 

sadasdsa


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 01-17-2017 , 17:27   sadasdsa
Reply With Quote #1

000000000000000000000

Last edited by Kellan123; 06-12-2017 at 10:19.
Kellan123 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-18-2017 , 05:09   Re: [SQL] How i get fast rank loading in AMXX ?
Reply With Quote #2

instead of looping through everything in the table in the plugin just fetch the rank and total number of entries from the database.

you can use the sql COUNT() to achieve this
jimaway is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 02-03-2017 , 09:40   Re: [SQL] How i get fast rank loading in AMXX ?
Reply With Quote #3

Still waiting for help ;)
Kellan123 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-03-2017 , 09:46   Re: [SQL] How i get fast rank loading in AMXX ?
Reply With Quote #4

Jimaway already told you what to do and you gave no feedback. Did you even try implementing what he proposed?
klippy is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 02-03-2017 , 17:41   Re: [SQL] How i get fast rank loading in AMXX ?
Reply With Quote #5

00000000000000000

Last edited by Kellan123; 06-12-2017 at 10:19.
Kellan123 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 02-06-2017 , 15:55   Re: [SQL] How i get fast rank loading in AMXX ?
Reply With Quote #6

Quote:
Originally Posted by Kellan123 View Post
i'm using this for rank and total !
PHP Code:
SELECT `lifes` as a, (SELECT COUNT(lifes) + 1 FROM `dr_statsWHERE `lifes` > a) as b, (SELECT COUNT(*) FROM `dr_stats`) as c FROM `dr_statsWHERE `authid` = '%s' 
but top is not correct why ?
PHP Code:
SELECT FROM `dr_statsORDER BY `lifesDESC 
i'm pretty sure the querys in parenthesis are parsed first in sql, therefore 'a' has no value when you are using it in the "WHERE" clause

try this:
Code:
SELECT (SELECT COUNT(*)
        FROM   dr_stats)                        AS total,
       (SELECT COUNT(*)
        FROM   dr_stats
        WHERE  lifes >= (SELECT lifes
                         FROM   dr_stats
                         WHERE  authid = '%s')) AS rank
jimaway is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode