Raised This Month: $ Target: $400
 0% 

LAG caused by SQL


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
abubhz
Junior Member
Join Date: Aug 2009
Old 08-15-2009 , 21:55   Re: LAG caused by SQL
Reply With Quote #7

MY CODE

PHP Code:
bool:fm_db_connect(&Sql:sql) {
 new 
Handle:g_SqlTuple
 
const LEN 128
 
new host[LEN], user[LEN], pass[LEN], db[LEN], error_msg[LEN]
 
get_cvar_string(CVAR_HOSThostLEN 1)
 
get_cvar_string(CVAR_USERuserLEN 1)
 
get_cvar_string(CVAR_PASSpassLEN 1)
 
get_cvar_string(CVAR_DBdbLEN 1)
 
 
g_SqlTuple SQL_MakeDbTuple(host,user,pass,db)
 
 new 
ErrorCode,Handle:SqlConnection SQL_Connect(g_SqlTuple,ErrorCode,error_msg,511)
 
 if(
SqlConnection == Empty_Handle){
  
// stop the plugin with an error message
  
set_fail_state(error_msg)
  
log_amx("[%s] ERROR - Can't connect to SQL db: %s"PLUGINNAMEerror_msg)
  
server_print("[%s] ERROR - Can't connect to SQL db: %s"PLUGINNAMEerror_msg)
  return 
false
 
  
else{
   
server_print("[%s] Successfully connected to SQL db."PLUGINNAME)
   return 
true
  
}
 }


Last edited by abubhz; 08-15-2009 at 22:43.
abubhz 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 18:18.


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