31.05.2012, 23:18
(
Последний раз редактировалось dannyk0ed; 31.05.2012 в 23:55.
)
I dont know if this is correct MySQL connection.
I'm not the best at MySQL but this is my function
-mysql.inc
Mine
I'm not the best at MySQL but this is my function
pawn Код:
native mysql_connect(const host[], const user[], const pass[], const db[], MySQL:handle = (MySQL:0), auto_reconnect = 0);
Mine
pawn Код:
public MySQLConnect(sqlhost[], sqluser[], sqlpass[], sqldb[])
{
FuncLog("MySQLConnect");
print("MYSQL: Attempting to connect to server...");
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, 1);//warning
if(mysql_ping() == 0)
{
print("MYSQL: Database connection established.");
return 1;
}
else
{
print("MYSQL: Could not connect! Retrying...");
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, 1);//warning
if(mysql_ping()==0)
{
return 1;
}
else
{
print("MYSQL: Could not reconnect to Database! Terminating server...");
SendRconCommand("exit");
return 0;
}
}
}
pawn Код:
C:\Users\Danny\Desktop\Server\gamemodes\WCRP2.pwn(48913) : warning 213: tag mismatch
C:\Users\Danny\Desktop\Server\gamemodes\WCRP2.pwn(48922) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
pawn Код:
serverlog
[19:21:52] [MySQL] Error (1): Function: mysql_connect failed, mysql was not initialized on this handle.
[19:21:52] MYSQL: Attempting to connect to server...
[19:21:52] *** Audio Plugin: Error binding endpoint for acceptor: Address already in use