Raised This Month: $ Target: $400
 0% 

How to get list from MySql


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-21-2011 , 03:49   How to get list from MySql
Reply With Quote #1

Hey, how to get list of players and other column from mysql ?

I want to get a list like that:

Name----SomeNum
Name2--SomeNum2
...

Then show it on Motd, like top

PS. Also how to get the numrow in sql table ? like in php
PHP Code:
mysql_num_rows($result); 
Is this the same ? http://www.amxmodx.org/funcwiki.php?go=func&id=1107

Whats wrong with that ? :

PHP Code:
public PrintCountMotd(id)
{
    new 
Motd[1256], szTemp[512];
    new 
iLen[555];
    new 
rowNum SQL_AffectedRows g_SqlTuple )
    new 
szName[33], iResult[33]
    for(new 
0rowNumi++)
    {
        
get_user_name(iszName32)
        
format(szTemp,charsmax(szTemp),"SELECT count FROM `count` WHERE name='%s'"szName)
        
iResult SQL_ReadResult(Query0)
        
        
iLen += formatex(Motd[iLen], charsmax(Motd) - iLen"%s - %d^n"szNameiResult)
    }
    
show_motd(idiLen"Admin count")


Last edited by reinert; 09-21-2011 at 04:17.
reinert is offline
 



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 19:41.


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