unknow mysql_ping
#1

Hi, i'm using BlueG's MySQL R33 plugin, im getting troubles while compiling this line:

Код:
if(mysql_ping(mConnectionHandle) == -1)
Unknown version mysql_ping.
Reply
#2

mysql_ping has been removed a long time ago. You do not need to check if the connection is dead so you can reconnect it, there is a parameter (autoreconnect) in mysql_connect which is set to true by default and it will do it for you.

Also update to R39-3.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
mysql_ping has been removed a long time ago. You do not need to check if the connection is dead so you can reconnect it, there is a parameter (autoreconnect) in mysql_connect which is set to true by default and it will do it for you..
Oh right, thanks.

Quote:

Also update to R39-3

Yes doing now.
Reply
#4

Up: Having some problems now while compiling:

PHP код:
for(new connectionCountconnectionCount MYSQL_CONNECTION_TRIESconnectionCount++)
            {
            
mConnectionHandle mysql_connect(SQLHostSQLUserSQLDatabaseSQLPassword);
            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_log(SQLDebug);
            break;
           }
           } 
error 029: invalid expression, assumed zero

When the 2nd "else" starts.
Reply
#5

Well yeah, you can't have two "else" within the same scope. Do it like this, though:
PHP код:
new connectionCount 1;
do
{
    
printf("connecting, attempt %d / %d"connectionCountMYSQL_CONNECTION_TRIES);
    
mConnectionHandle mysql_connect(...);
}
while(!
mConnectionHandle && connectionCount++ < MYSQL_CONNECTION_TRIES);
if(!
mConnectionHandle)
{
    
// failed to connect shiz
    
return 0;
}
// rest of gamemodeinit 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)