MySQL R33 problem
#1

Ok i have the BlueG's MySQL R33 plugin and this code on OnGameModeInit:

pawn Код:
for(new connectionCount; connectionCount < MYSQL_CONNECTION_TRIES; connectionCount++)
    {
        mConnectionHandle = mysql_connect(SQLHost, SQLUser, SQLDatabase, SQLPassword);
        if(mysql_ping(mConnectionHandle) == -1)
        {
            if(connectionCount == MYSQL_CONNECTION_TRIES - 1)
            {
                printf("The server has failed to connect to MySQL the maximum amount of times, shutting down...");
                SendRconCommand("exit");
                return 1;
            }
            else
            {
                printf("Failed to connect to MySQL, retrying...");
            }
        }
        else
        {
            printf("The server has successfully connected to MySQL!");
            mysql_debug(SQLDebug);
            break;
        }
    }
But, while compiling i get undefined symbol "mysql_ping".

I tried to remove this line
pawn Код:
if(mysql_ping(mConnectionHandle) == -1)
with all the brackets but nothing.
Reply
#2

This native has been removed. Use mysql_errno != 0

Also, upgrade to R34.
Reply
#3

mysql_ping has been removed in earlier versions. There's also auto-reconnect parameter in mysql_connect but it's better to exit the mode in any error.

pawn Код:
mConnectionHandle = mysql_connect(SQLHost, SQLUser, SQLDatabase, SQLPassword);
if (mysql_errno())
{
    printf("The server has failed to connect to MySQL, shutting down...");
    SendRconCommand("exit");
}
else
{
    printf("The server has successfully connected to MySQL!");
    mysql_log(LOG_DEBUG);
}
Reply
#4

Oh, thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)