Mysql mysql_ping undefined?
#3

Quote:
Originally Posted by arakuta
Посмотреть сообщение
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.
Yes but what about if you lose connection of the mysql database?

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;
}
Reply


Messages In This Thread
Mysql mysql_ping undefined? - by Admigo - 09.03.2014, 12:12
Re: Mysql mysql_ping undefined? - by arakuta - 09.03.2014, 12:17
Re: Mysql mysql_ping undefined? - by Admigo - 09.03.2014, 12:18
Re: Mysql mysql_ping undefined? - by RenovanZ - 09.03.2014, 12:23
Re: Mysql mysql_ping undefined? - by arakuta - 09.03.2014, 12:25
Re: Mysql mysql_ping undefined? - by Admigo - 09.03.2014, 12:31
Re: Mysql mysql_ping undefined? - by RenovanZ - 09.03.2014, 12:34
Re: Mysql mysql_ping undefined? - by Admigo - 09.03.2014, 12:37
Re: Mysql mysql_ping undefined? - by RenovanZ - 09.03.2014, 12:38
Re: Mysql mysql_ping undefined? - by Admigo - 09.03.2014, 12:42

Forum Jump:


Users browsing this thread: 2 Guest(s)