09.03.2014, 12:18
Quote:
This function was descontinued, cause there is no use to it anymore.
The MySQL connection will be always alive until you use mysql_close, or exit your gamemode. |
EDIT: Or when the server has failed to connect to the database?
pawn Код:
stock ConnectToDatabase()
{
gSQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS);
printf("Connecting to the Local Database...");
if(mysql_ping(gSQL) == 1)
{
//printf("Successfully connected to the MySQL server");
printf("Successfully connected to MySQL server | %s", MYSQL_HOST);
}
else
{
//gSQL = mysql_connect(MYSQL_HOST_HOST, MYSQL_USER_HOST, MYSQL_DB_HOST, MYSQL_PASS_HOST);
//printf("Connecting to the Hosted Database...");
printf("Cannot connect to MySQL Server | %s aborting...", MYSQL_HOST);
//SendRconCommand("exit");
}
return 1;
}