MySQL Ping - 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 Ping (
/showthread.php?tid=600706)
MySQL Ping -
Zamora - 11.02.2016
Hello there, Sorry I'm facing proplem with this things, I'm newbie with MySQL still trying to learn it.
pawn Код:
error 017: undefined symbol "mysql_ping"
pawn Код:
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 Ping -
Loinal - 11.02.2016
if(mysql_ping(dbname) == -1 or 1) as you want
if i helped +rep me
Re: MySQL Ping -
itsCody - 11.02.2016
If you're using the latest MySQL, you don't need Mysql_ping
PHP код:
if(!mysql_errno()) print("MySQL Connection Success");
else print("MySQL Connection Failed");