Raised This Month: $ Target: $400
 0% 

[help] Sql Lags ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
katna
Senior Member
Join Date: May 2010
Old 01-14-2011 , 10:27   [help] Sql Lags ?
Reply With Quote #1

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.
katna is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 01-14-2011 , 16:35   Re: [help] Sql Lags ?
Reply With Quote #2

You probably made some mistake. Post the code and maybe someone will be able to fix it for you.
__________________
Impossible is Nothing
Sylwester is offline
katna
Senior Member
Join Date: May 2010
Old 01-17-2011 , 04:42   Re: [help] Sql Lags ?
Reply With Quote #3

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)
}
katna is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 01-17-2011 , 05:36   Re: [help] Sql Lags ?
Reply With Quote #4

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)

__________________
Impossible is Nothing
Sylwester is offline
Reply



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 02:11.


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