Raised This Month: $ Target: $400
 0% 

[Help] SQLx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-24-2012 , 07:21   [Help] SQLx
Reply With Quote #1

PHP Code:
public Load_Status(id)
{
    new 
szSteamId[32], szTemp[512]
    
get_user_authid(idszSteamIdcharsmax(szSteamId))
    
    new 
Data[1]
    
Data[0] = id
    
    format
(szTemp,charsmax(szTemp),"SELECT nick, skill FROM %s WHERE steamID = '%s'",Table,szSteamId)
    
SQL_ThreadQuery(g_SqlTuple,"Load_Status2",szTemp,Data,1)
}

public 
Load_Status2(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_NumResults(Query) < 1
    {
       
// some code here
    

    else 
    {
        
SQL_ReadResult(Query0nick[id], 32)
        
SQL_ReadResult(Query1Skill[id], 32)        
    }
    
    return 
PLUGIN_HANDLED

Player1- quark
Player2- Player

So, this is loading the nickname currectly, but if 2 players enter the server, it says that the first player is quark, but when the second player enter, it says that the second player name is Player, and the first player is qPlayer.

All help are welcome
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark 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 08:14.


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