AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   sadasdsa (https://forums.alliedmods.net/showthread.php?t=292912)

Kellan123 01-17-2017 17:27

sadasdsa
 
000000000000000000000

jimaway 01-18-2017 05:09

Re: [SQL] How i get fast rank loading in AMXX ?
 
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

Kellan123 02-03-2017 09:40

Re: [SQL] How i get fast rank loading in AMXX ?
 
Still waiting for help ;)

klippy 02-03-2017 09:46

Re: [SQL] How i get fast rank loading in AMXX ?
 
Jimaway already told you what to do and you gave no feedback. Did you even try implementing what he proposed?

Kellan123 02-03-2017 17:41

Re: [SQL] How i get fast rank loading in AMXX ?
 
00000000000000000

jimaway 02-06-2017 15:55

Re: [SQL] How i get fast rank loading in AMXX ?
 
Quote:

Originally Posted by Kellan123 (Post 2492544)
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



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

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