MySQL Error - 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)
+--- Thread: MySQL Error (
/showthread.php?tid=543905)
MySQL Error -
Jennifer - 29.10.2014
I got an error after I updated to new MySQL plugin. How do I fix this?
undefined symbol "mysql_ping"
Код:
stock ConnectMySQL()
{
dbHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
mysql_debug(1);
if(mysql_ping() == -1)
{
printf("Failed to connect to MySQL !");
} else {
printf("Connected to MySQL !");
}
return 1;
}
Re: MySQL Error -
nemesis- - 29.10.2014
Quote:
Originally Posted by Jennifer
I got an error after I updated to new MySQL plugin. How do I fix this?
undefined symbol "mysql_ping"
Код:
stock ConnectMySQL()
{
dbHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_errno() == -1) printf("Failed to connect to MySQL !");
else printf("Connected to MySQL !");
return 1;
}
|
The above should do it. I shrunk your if-then-else statement too. I pulled the mysql_debug() too as it is no longer in the newer versions. That is mysql_log.
Re: MySQL Error -
Jennifer - 29.10.2014
Made it work, thanks a lot