Raised This Month: $ Target: $400
 0% 

Sql Queries


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
zeus
Senior Member
Join Date: Jul 2008
Old 11-30-2010 , 18:26   Re: Sql Queries
Reply With Quote #9

Code:
new Handle:g_SqlConnection
public MySql_Init()
{
    g_SqlTuple = SQL_MakeDbTuple(Host,User,Pass,Db)
    new ErrorCode
    g_SqlConnection=SQL_Connect(g_SqlTuple,ErrorCode,g_Error,charsmax(g_Error))
    if(g_SqlConnection == Empty_Handle)
        set_fail_state(g_Error)
    SQL_FreeHandle(g_SqlConnection)
}

public Load_MySql(id)
{
    new szSteamId[32], szTemp[512]
    get_user_authid(id, szSteamId, charsmax(szSteamId))
    
    new Data[1]
    Data[0] = id
    
    format(szTemp,charsmax(szTemp),
    "SELECT * FROM `%s` \ 
    WHERE (`%s`.`authid` = '%s')",
    gTn,gTn,szSteamId);
    SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
    
    SQL_FreeHandle(g_SqlConnection)
}
zeus 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 11:20.


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