15.09.2013, 19:15
Hi guys, i wanted to know why my gamemode won't connect to my database... Here's the script 'ConnectToMySQL'...
SA-MP Server crashes after trying to connect, it says 'Connecting to MySQL server...' and 'Unable to connect to MySQL server...Quitting' and it crashes... Why? Thanks in advance.
pawn Код:
stock connectToMysql() {
if(server_enviroment == ENVIROMENT_DEV) {
mysql_connect("localhost","serverplurirp","my_serverplurirp","");
if(mysql_ping() == -1) { print("Unable to connect to MySQL server... Quitting"); SendRconCommand("exit"); } else { print("Connected to MySQL server"); }
print("Server Enviroment: DEV");
} else if (server_enviroment == ENVIROMENT_LIVE) {
mysql_connect("localhost","serverplurirp","my_serverplurirp","");
if(mysql_ping() == -1) { print("Unable to connect to MySQL server... Quitting"); SendRconCommand("exit"); } else { print("Connected to MySQL server"); }
print("Server Enviroment: LIVE");
} else {
print("Unknown server enviroment, quitting.");
SendRconCommand("exit");
}
}