Raised This Month: $ Target: $400
 0% 

SQL Top


Post New Thread Reply   
 
Thread Tools Display Modes
maza51
Senior Member
Join Date: Mar 2010
Old 02-05-2011 , 09:01   Re: SQL Top
Reply With Quote #21

Помоему ты не понимаешь меня.

Что толку что я выберу без ограничения?
Я хочу сделать что б при написании в чат "rank" писалось какое место в ранке я занимаю и поинты.

Но я не знаю как сделать место. Я могу посмотреть только сколько у меня поинтов.


I want to do what would you write a chat with "rank" was written some place in the wound I take and Points.

But I do not know how to make the place. I can see just how much my points.
maza51 is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 02-05-2011 , 09:15   Re: SQL Top
Reply With Quote #22

Iterate through the rows in ordered result. The row index is a position.
__________________
FaTony is offline
maza51
Senior Member
Join Date: Mar 2010
Old 02-05-2011 , 09:25   Re: SQL Top
Reply With Quote #23

Thanks. A sample can show?
maza51 is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 02-05-2011 , 09:59   Re: SQL Top
Reply With Quote #24

PHP Code:
new rank;
new 
bool:found false;
for (
rank 1SQL_MoreRows(...); SQL_FetchRow(...), rank++)
{
   if (
steamid == ...)
   {
      
found true;
      break;
   }

__________________

Last edited by FaTony; 02-05-2011 at 10:01.
FaTony is offline
maza51
Senior Member
Join Date: Mar 2010
Old 02-05-2011 , 10:38   Re: SQL Top
Reply With Quote #25

I did not get ...
maza51 is offline
maza51
Senior Member
Join Date: Mar 2010
Old 02-05-2011 , 11:29   Re: SQL Top
Reply With Quote #26

Thank you all. I found another solution.
maza51 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-05-2011 , 11:31   Re: SQL Top
Reply With Quote #27

It would be helpful if you posted your solution for others who may have the same problem.
__________________
Silvers is offline
maza51
Senior Member
Join Date: Mar 2010
Old 02-05-2011 , 12:01   Re: SQL Top
Reply With Quote #28

I first learned how many points
Code:
SELECT * FROM 'Rank' WHERE steamId ='%s'
Later I found out how many rows in the database are taller than me
Code:
SELECT * FROM 'Rank' WHERE points >= '%i'
obtained
Code:
new rank = SQL_GetRowCount(query);
maza51 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 04:43.


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