11.08.2017, 19:03
Код HTML:
#define SQL_HOST "localhost" #define SQL_USER "root" #define SQL_PASS "" #define SQL_DB "server2" function ConnectionDB() { mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); if(mysql_errno(mysql) == 0) { printf("SQL: The connection to database has been established successfully.", SQL_DB); printf("\n"); } else { printf("SQL: %s can't connect to %s hosted on %s.", SQL_USER, SQL_DB, SQL_HOST); SendRconCommand("exit"); } return 1; } And this is under OnGameModeInit ConnectionDB();