Total Entries in MySql
Code:
public Show_Rank(id) // register cmd to this functionhow do i get the total entries to make it show like this: "You are at rank %i from %i with %i exp" being the second "%i" the total entries/players. Thanks in advance! |
Re: Total Entries in MySql
Code:
SELECT COUNT(column_name) FROM table_name; |
Re: Total Entries in MySql
Code:
SELECT COUNT(*) AS total, SUM(CASE WHEN exp >= %d THEN 1 ELSE 0 END) AS rank FROM tutorial |
Re: Total Entries in MySql
and how do i make it appearing in the chat?
like this? Code:
format(szTemp,charsmax(szTemp),"SELECT COUNT(*) AS total, SUM(CASE WHEN exp >= %d THEN 1 ELSE 0 END) AS rank FROM tutorial", total[id])Code:
client_print(id, print_chat, "You are at rank %i from %i with %i exp", count, total[id], Exp[id]);because i have tried and it doesn't work :( |
Re: Total Entries in MySql
What doesn't work? It's not total[id]. That should be Exp[id] like you had it before.
You need to use new TotalPlayers = SQL_ReadResult(Query, 0) new Rank = SQL_ReadResult(Query, 1) |
Re: Total Entries in MySql
but the
SQL_ReadResult(Query, 0) is already set to count the rank. can you change in the code i posted before? |
Re: Total Entries in MySql
you could always also
PHP Code:
you can use the same query you used to get the rank, but without the name / steamid / ip condition at the end(WHERE xxxxx) |
Re: Total Entries in MySql
Quote:
|
Re: Total Entries in MySql
Quote:
|
Re: Total Entries in MySql
Quote:
|
| All times are GMT -4. The time now is 13:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.