[MSQL] Problem with connection, to MSQL database.
#1

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.
Reply
#2

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.
Reply
#3

Thank you, for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)