Raised This Month: $ Target: $400
 0% 

SQL_PrepareQuery Run Time Error 10


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Russianeer
SourceMod Donor
Join Date: Feb 2011
Old 04-24-2011 , 22:52   Re: SQL_PrepareQuery Run Time Error 10
Reply With Quote #5

I set a timer on plugin_init, to connect to the SQL database after 1 second.

This is the connection:
PHP Code:
public MYSQLX_Init()
{
    new 
sqlhostname[35],sqluser[35],sqlpass[35],sqldbname[35];
    
    
get_cvar_string("zp_sql_host"sqlhostname,34);
    
get_cvar_string("zp_sql_user"sqluser,34);
    
get_cvar_string("zp_sql_pass"sqlpass,34);
    
get_cvar_string("zp_sql_db"sqldbname,34);

    
// Determine the database information
    
new szError[256], iErrNum;

    
// Set up the tuple that will be used for threading
    
g_DBTuple SQL_MakeDbTuple(sqlhostnamesqlusersqlpasssqldbname );

    
// Attempt to connect
    
g_DBConn SQL_Connect(g_DBTupleiErrNumszError255);

    if (!
g_DBConn)
    {
        
log_to_file("ZP-Bank.log""[ZP-APS] Database Connection Failed: [%d] %s"iErrNumszError);

        return;
    }

    
DBConnection true;
    
server_print("[ZP-APS] MySQL database connection successful");

Russianeer 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 19:46.


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