AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] Sql Lags ? (https://forums.alliedmods.net/showthread.php?t=147806)

katna 01-14-2011 10:27

[help] Sql Lags ?
 
hello, im using this tutorial by grimvh2
http://66.228.116.138/showthread.php?t=132686
but with a bigger sql which contain 30 columns and everytime someone enter to the server, my server lag. My server is only running one mod, so it can't be anything else.
my question is why the server is lagging? how can i reduce the lags?
Even when i had Superhero mod enabled the server didn't lag, but somehow with this sql the server lag.
I tried to change the sql but same results.

Sylwester 01-14-2011 16:35

Re: [help] Sql Lags ?
 
You probably made some mistake. Post the code and maybe someone will be able to fix it for you.

katna 01-17-2011 04:42

Re: [help] Sql Lags ?
 
Code:

public LoadStats(id)
{
        new errorCode,Handle:MySqlConnection = SQL_Connect(g_SqlTuple,errorCode,g_Error,charsmax(g_Error))
   
        if(g_SqlTuple == Empty_Handle)
                set_fail_state(g_Error)
       
        new szSteamId[32]
        new Data[1]
        new szTemp[512]
       
        get_user_authid(id, szSteamId, charsmax(szSteamId))
        Data[0] = id
       
        format(szTemp,charsmax(szTemp),"SELECT * FROM `money` WHERE (`money`.`steamid` = '%s')", szSteamId)
       
        SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
        SQL_FreeHandle(MySqlConnection)
}


Sylwester 01-17-2011 05:36

Re: [help] Sql Lags ?
 
try this:
PHP Code:

public LoadStats(id)
{
    new 
szSteamId[32]
    new 
Data[1]
    new 
szTemp[512]
    
    
get_user_authid(idszSteamIdcharsmax(szSteamId))
    
Data[0] = id
    
    format
(szTemp,charsmax(szTemp),"SELECT * FROM `money` WHERE (`money`.`steamid` = '%s')"szSteamId)
    
    
SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)




All times are GMT -4. The time now is 02:11.

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