bug in mysql
#1

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 017undefined symbol "mysql_ping" 
sorry my English Bad
tx for helpers
Reply
#2

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

Reply
#3

If you use another version of MySQL Plugin and it's not r33 -- r39. take update.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)