08.08.2010, 20:43
Hello. I'm using MySQL Plugin R4 (VS9) by G-sTyLeZzZ (with libmysql.dll too) and having problem with this code:
It doesn't print message if I turn the MySQL server off or change host/user/db/pass to incorrect. The MYSQL_* fields are defined 100% correctly. I've turned on the MySQL debugging, and it works fine (connect successful if everything is correct and mysql server is up, and fail to connect if something is wrong or mysql server is down). Is the above code correct to check the mysql connection success or fail?
pawn Код:
public OnGameModeInit()
{
if (!mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS)) print("ERROR: Failed to connect database!");
return 1;
}