MySQL question..
#1

NOTE: i use BlueG MySQL Plugin, R6

in my OnGameModeInit i have this...

pawn Код:
// 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!");
and when i load the sa-mp server.exe... print

MySQL connection is still alive!

MySQL connection is still alive!

why ??
Reply
#2

Where is this placed? Make sure its not within a loop and shit, if you mean it keeps spamming "MySQL connection is still alive!".

You were very vague, please re-explain if this is not the correct answer.
Reply
#3

is placed in OnGameModeInit.. and i have no loop in the gamemode..
Reply
#4

help ??
Reply
#5

Quote:
Originally Posted by Speed++
Посмотреть сообщение
help ??
pawn Код:
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;
}
Reply
#6

Quote:
Originally Posted by FalconX
Посмотреть сообщение
pawn Код:
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;
}
thanks but, does not change anything :\

image..



debug logs:

Код:
[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.
logs:

Код:
----------
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]
Reply
#7

mhmm ??
Reply
#8

Quote:
Originally Posted by Speed++
Посмотреть сообщение
mhmm ??
Show us your OnGameModeInit?
Reply
#9

I noticed this too, I though I was doing something wrong, but seems it's a bug?
Reply
#10

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
I noticed this too, I though I was doing something wrong, but seems it's a bug?
possible, :\ i have controlled my code 100 %.. is correct..


Quote:
Originally Posted by FalconX
Посмотреть сообщение
Show us your OnGameModeInit?
yes.. this is the ongamemodeinit..

NOTE: i use BlueG MySQL Plugin, R6

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)