SA-MP Forums Archive
MySQL problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL problem (/showthread.php?tid=250532)



MySQL problem - Pooh7 - 23.04.2011

Code:
[18:06:03] CMySQLHandler::Query(SELECT * FROM `Igraci` WHERE `Ime` = 'Frankie_Marcello') - An error has occured. (Error ID: 2013, Lost connection to MySQL server during query)
I'm using G-sTyLeZzZ's MySQL plugin.
My server is on Windows but web server is on Linux.

I get this error everytime when I connect to server. What is the problem? :/


Re: MySQL problem - [L3th4l] - 23.04.2011

It resets your connection over time. Happened to me. I all did was make a timer and check for the mysql_ping
if it returned 0 i used the mysql_reconnect function.

pawn Code:
SetTimer("CheckConn", time, true);

forward CheckConn();
public CheckConn()
{
    if(mysql_ping() == 1)
    {
        // Connection alive
    }
    else
    {
        mysql_reconnect();
        // Connection was dead
    }
}



Re: MySQL problem - Pooh7 - 23.04.2011

It works, thank you