// mysql debug
mysql_debug(1);
// iConnectionHandle
iConnectionHandle = mysql_connect(HOST_MySQL, USER_MySQL, DATA_MySQL, PASS_MySQL);
if(mysql_ping()) print("MySQL connection is still alive!");
if(!mysql_ping()) print("MySQL connection is dead!");
??
public OnGameModeInit()
{
// mysql debug
mysql_debug( 1 );
// iConnectionHandle
iConnectionHandle = mysql_connect( HOST_MySQL, USER_MySQL, DATA_MySQL, PASS_MySQL );
if( mysql_ping( ) >= 1 ) // if pings are 1 or more then 1 that means the connection is alive
{
print( "MySQL connection is alive!" );
}
else // dead
{
print( "MySQL connection is dead!" );
}
return 1;
}
|
pawn Код:
|

[00:24:15] --------------------------- [00:24:15] MySQL Debugging activated (08/13/12) [00:24:15] --------------------------- [00:24:15] [00:24:15] >> mysql_connect( ) [00:24:15] CMySQLHandler::CMySQLHandler() - constructor called. [00:24:15] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "db_test" | Username: "root" ... [00:24:15] CMySQLHandler::Connect() - Connection was successful. [00:24:15] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [00:24:15] >> mysql_ping( Connection handle: 1 ) [00:24:15] CMySQLHandler::Ping() - Connection is still alive. [00:24:15] [00:24:15] --------------------------- [00:24:15] MySQL Debugging activated (08/13/12) [00:24:15] --------------------------- [00:24:15] [00:24:15] >> mysql_connect( ) [00:24:15] CMySQLHandler::Connect() - Connection was successful. [00:24:15] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [00:24:15] >> mysql_ping( Connection handle: 1 ) [00:24:15] CMySQLHandler::Ping() - Connection is still alive. [00:28:16] >> mysql_close( Connection handle: 1 ) [00:28:16] CMySQLHandler::~CMySQLHandler() - deconstructor called. [00:28:16] CMySQLHandler::FreeResult() - The result is already empty. [00:28:16] CMySQLHandler::Disconnect() - Connection was closed.
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3e-R2, ©2005-2012 SA-MP Team [13/08/2012 00:24:15] [13/08/2012 00:24:15] Server Plugins [13/08/2012 00:24:15] -------------- [13/08/2012 00:24:15] Loading plugin: mysql [13/08/2012 00:24:15] > MySQL plugin R5 successfully loaded. [13/08/2012 00:24:15] Loaded. [13/08/2012 00:24:15] Loading plugin: Whirlpool [13/08/2012 00:24:15] [13/08/2012 00:24:15] ================== [13/08/2012 00:24:15] [13/08/2012 00:24:15] Whirlpool loaded [13/08/2012 00:24:15] [13/08/2012 00:24:15] ================== [13/08/2012 00:24:15] [13/08/2012 00:24:15] Loaded. [13/08/2012 00:24:15] Loaded 2 plugins. [13/08/2012 00:24:15] [13/08/2012 00:24:15] Filterscripts [13/08/2012 00:24:15] --------------- [13/08/2012 00:24:15] Loaded 0 filterscripts. [13/08/2012 00:24:15] MySQL connection is alive! [13/08/2012 00:24:15] MySQL connection is alive! [13/08/2012 00:24:15] Number of vehicle models: 0 Console input: exit [13/08/2012 00:28:16] --- Server Shutting Down. [13/08/2012 00:28:16]
??
|
I noticed this too, I though I was doing something wrong, but seems it's a bug?
![]() |
public OnGameModeInit()
{
// mysql debug
mysql_debug(1);
// iConnectionHandle
iConnectionHandle = mysql_connect(HOST_MySQL, USER_MySQL, DATA_MySQL, PASS_MySQL);
if(mysql_ping() >= 1) // if pings are 1 or more then 1 that means the connection is alive
{
print("MySQL connection is alive!");
}
else // dead
{
print("MySQL connection is dead!");
}
// SetGameModeText
SetGameModeText("MySQL GM WIP");
// AddPlayerClass
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}