PDA

View Full Version : [MSQL] Problem with connection, to MSQL database.


Type-R
10/10/2011, 01:48 AM
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.

[HiC]TheKiller
10/10/2011, 01:53 AM
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.

Type-R
10/10/2011, 03:08 AM
Thank you, for your help. :)