Raised This Month: $ Target: $400
 0% 

top10 mysql Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stylaa
Senior Member
Join Date: Oct 2009
Location: Flensburg, Germany
Old 10-23-2010 , 11:11   top10 mysql Problem
Reply With Quote #1

got an error it displays on all names 48 Kills and dont shows the best 15

How to fix?

PHP Code:

    
public ShowTop10(id) {
    
    new 
szTemp[512]
    static 
Data[2]
    
    
Data[0] = id

    format
(szTemp,charsmax(szTemp),"SELECT * FROM stats ORDER BY points ASC LIMIT 10")
    
SQL_ThreadQuery(g_SqlTuple,"displaytop10",szTemp,Data,2)
    
}


public 
displaytop10(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState == TQUERY_CONNECT_FAILED)
    {
        
log_amx("Load - Could not connect to SQL database.  [%d] %s"ErrcodeError)
    }
    else if(
FailState == TQUERY_QUERY_FAILED)
    {
        
log_amx("Load Query failed. [%d] %s"ErrcodeError)
    }

    new 
id
    id 
Data[0]
    
        
    if(!
SQL_MoreResults(Query)) {
        
        
        return 
1
    
}
    
    
    static 
Name[33], PlacePoints[33]
    
    
Place 0
    
    
new MenuBody[512], lenkeys;
    
    
len format(MenuBody511"\yStats TOP 10 \r[Version: \y%s\r]^n"VERSION);
    
    while(
SQL_MoreResults(Query)) {
        
        
Place++
        
        
SQL_ReadResult(Query,7,Name,32)
        
        
SQL_ReadResult(Query,1,Points,32)
        
        
len += format(MenuBody[len], 511-len"^n\r%d. %s %d Kills"PlaceNamePoints);
        
        
SQL_NextRow(Query)
    }

    
    
keys = ( 1<<1<<1<<);
    
    if( 
get_user_flags(id) & ADMIN_USER 
    
keys |= ( 1<<1<<1<<1<<1<<1<<);

    
show_menu(idkeysMenuBody, -1"StatsMenu");
    
    return 
0

__________________

Some People brings Happynes by Coming
Some by Going
Stylaa is offline
Send a message via ICQ to Stylaa
 


Thread Tools
Display Modes

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 10:26.


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