[MSQL] Problem with connection, to MSQL database. - 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: [MSQL] Problem with connection, to MSQL database. (
/showthread.php?tid=289086)
[MSQL] Problem with connection, to MSQL database. -
Type-R - 10.10.2011
Hello, im Newbie with MSQL, cause is started not long ago. I have a problem, because it always says that it connects to MySQL Database, even if i turn it off... Here's the script:
Код:
ConnectMySQL()
{
if(mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS))
print("[MySQL] Connection to the MySQL Database was successfully!");
else
print("[MySQL] Could not connect to the MySQL Database!");
}
Please help me, if you know what is the problem.
Re: [MSQL] Problem with connection, to MSQL database. -
[HiC]TheKiller - 10.10.2011
It doesn't return the success of the connection, it returns the Connection handle
. Use mysql_ping to check if it's connected. I'm not sure what value it would return if it could not connect so try using mysql_ping.
Re: [MSQL] Problem with connection, to MSQL database. -
Type-R - 10.10.2011
Thank you, for your help.