PING with "a_mysql"
#1

Hello,

I would like to know how obtain the ping from the include "a_samp.inc" ?

I test like that:

Код:
	if(mysql_ping()==0)
	{
		print("MYSQL: Database connection established.");
		return 1;
	}
But mysql_ping doesn't exist...
How I can do that ?

Regards
Reply
#2

I newer versions, this function doesn't exist because the MySQL plugin will automatically reconnect if it loses connection. I suppose you could check if the connection handle is valid (i.e. > 0).
Reply
#3

There is mysql_errno, so simply:

pawn Код:
mysql_connect(.....

if(mysql_errno() != 0)
{
    print(!"MySQL: Failed to connect.");
    SendRconCommand("exit");
    return false;
}
print(!"MySQL: Connecting successful!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)