27.10.2014, 19:34
Tr this, thats the wy it need to be used.
i hope i helped you.
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;
}