Mysqll connect failed i need mysql_close?
#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


Messages In This Thread
Mysqll connect failed i need mysql_close? - by Banditukas - 27.10.2014, 17:57
Re: Mysqll connect failed i need mysql_close? - by Thomaske - 27.10.2014, 19:34

Forum Jump:


Users browsing this thread: 3 Guest(s)