S:\SAMP Stuff\gamemodes\new.pwn(229) : error 029: invalid expression, assumed zero S:\SAMP Stuff\gamemodes\new.pwn(229) : warning 217: loose indentation S:\SAMP Stuff\gamemodes\new.pwn(229) : error 029: invalid expression, assumed zero S:\SAMP Stuff\gamemodes\new.pwn(230) : error 029: invalid expression, assumed zero S:\SAMP Stuff\gamemodes\new.pwn(230) : error 029: invalid expression, assumed zero S:\SAMP Stuff\gamemodes\new.pwn(230) : error 029: invalid expression, assumed zero S:\SAMP Stuff\gamemodes\new.pwn(230) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
options_id = mysql_init_options();
DBConnect = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, options_id);
mysql_set_option(options_id, AUTO_RECONNECT, false);
if(DBConnect == MYSQL_INVALID_HANDLE || mysql_errno(DBConnect) != 0)
{ //Line 229
print("Connection to MySQL Database unsucessful. Exiting...."); //Line 230
SendRconCommand("Exit");
return 1;
}
MySQL_errorno(DBConnect)
new MySQLOpt:options_id = mysql_init_options();
mysql_set_option(options_id, AUTO_RECONNECT, false);
DBConnect = mysql_connect((MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, options_id);
if(mysql_errno(DBConnect ) != 0 || DBConnect == MYSQL_INVALID_HANDLE)
{
print("\n----------------------------------------------------");
print("[ERROR] Cannot establish connection to MySQL database!");
printf("[MYSQL] ERROR CODE: %d", mysql_errno(DBConnect ));
print("----------------------------------------------------");
}
else
{
print("[MYSQL] Connection to MySQL database established successfully!");
}
|
Hey I've taken your code and tried it in the below format which seems to work, could you possibly try this?
Код:
new MySQLOpt:options_id = mysql_init_options();
mysql_set_option(options_id, AUTO_RECONNECT, false);
DBConnect = mysql_connect((MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, options_id);
if(mysql_errno(DBConnect ) != 0 || DBConnect == MYSQL_INVALID_HANDLE)
{
print("\n----------------------------------------------------");
print("[ERROR] Cannot establish connection to MySQL database!");
printf("[MYSQL] ERROR CODE: %d", mysql_errno(DBConnect ));
print("----------------------------------------------------");
}
else
{
print("[MYSQL] Connection to MySQL database established successfully!");
}
|
if(DBConnect && mysql_errno(DBConnect) == 0)
{
printf("[MySQL]: Connection to database successfully established!");
}
else
{
printf("[MySQL]: Connection to database failed!");
}