Mysqll connect failed i need mysql_close?
#1

I mean

Код:
mysql_connect( ... ).
if(mysql_errno() != 0)
{
mysql_close();
}
Reply
#2

Tr this, thats the wy it need to be used.

pawn Код:
//put this on top of your scrip in the defines and fill them in correctly.

#define mysql_host "yourhost"//mostly localhost
#define mysql_user "yourusername"
#define mysql_password "yourpassword"
#define mysql_database "yourdatabasename"

new MySQLCon;//add this on top of your script (with the global variables)


public OnGameModeInit()
{
    MySQLCon = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);//connection string
    if(mysql_errno(MySQLCon) != 0) print("Could not connect to database!");//check for errors
    mysql_log(LOG_ERROR | LOG_WARNING, LOG_TYPE_HTML);//error/warning logs in main folder of server (mysql_log.txt)

        //rest of OnGameModeInit
    return 1;
}
i hope i helped you.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)