Raised This Month: $ Target: $400
 0% 

Fixing "SQL_QuoteString"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 05-25-2010 , 14:35   Re: Fixing "SQL_QuoteString"
Reply With Quote #1

No need to check that, since there isn't any sql handle used...
line 393:
PHP Code:
SQL_QuoteString(Empty_Handle,dest,len,server_name
You can't pass Empty_Handle as a first argument to that function, you must use sql connection handle.
PHP Code:
//1. Define handles
new Handle:g_sql_tuple
new Handle:g_sql_connection

//2. MakeDbTuple and SQL_Connect
public sql_init(){
    new 
host[32], user[32], pass[32], db[32]
    
//get host, user, pass, db ...
    
g_sql_tuple SQL_MakeDbTuple(hostuserpassdb)
    new 
err[512], err_code
    g_sql_connection 
SQL_Connect(g_sql_tuple,err_code,err,511)
    if(
g_sql_connection == Empty_Handle){
        
log_amx("SQL Error: %s (%d)"errerr_code)
        
//SQL_Connect failed, so we can't use g_sql_connection handle
    
}
}

//3. Use handle in SQL_QuoteString (you must use g_sql_connection, not g_sql_tuple)
SQL_QuoteString(g_sql_connectiondestlensource)

//4. Free sql connection handle in plugin_end
public plugin_end(){
    if(
g_sql_connection != Empty_Handle)
        
SQL_FreeHandle(g_sql_connection)

__________________
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 05:27.


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