bug in mysql - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: bug in mysql (
/showthread.php?tid=568473)
bug in mysql -
Include1 - 22.03.2015
How do I set it up
I should set it define or new?
PHP код:
if(mysql_ping()) print("MySQL: connection is still alive!");
if(!mysql_ping()) print("MySQL: connection is dead!");
PHP код:
error 017: undefined symbol "mysql_ping"
sorry my English Bad

tx for helpers
Re: bug in mysql -
Konstantinos - 22.03.2015
mysql_ping has been removed a while back so for newer versions of the plugin, you can use "autoreconnect" parameter in
mysql_connect to enable automatic reconnection.
In case you want to reconnect it, there's a function for it:
https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_reconnect
You can also check at the beginning if the connection was successful or not by using
mysql_errno. An example:
PHP код:
// you can store it in a variable if you want to:
mysql_connect(...);
if (!mysql_errno())
{
// connection successful
}
else
{
// connection failed
}
Re: bug in mysql -
scaunel - 22.03.2015
If you use another version of MySQL Plugin and it's not r33 -- r39. take update.