01.01.2014, 19:09
Hello, i very a problem with my mysql system. When i join for the first time it asks me to register, and until now is ok. But when i rejoin, i have to register again! Seems the server can't save the tables in the database.
Here is the stock which handles the registration:
And this is mysql log file:
The connection with the database is ok, the tables are already created and mysql_connect is placed on OnGameModeInit.
Here is the stock which handles the registration:
pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
new query1[256*2], pname[24];
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
new RegDate[128];
format(RegDate, 128, "%d:%d:%d - %d/%d/%d", Hour, Minute, Second, Day, Month, Year);
new Bannedby[20];
format(Bannedby, 20, "Not Banned");
GetPlayerName(playerid, pname, 24);
format(query1, sizeof(query1), "INSERT INTO playerdata (user, password, Scores, Cash, Admin, Deaths, Nopm, Muted, Vip, Warn, RegisterDate, Jailed, AdminActions, Cookies, Rank, VipTime, Class, PrototypesStolen, KillAsUsaTeam, KillAsGermanyTeam, KillAsItalyTeam, KillAsJapanTeam, KillAsMercTeam, KillAsMexicoTeam, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s')", pname, passwordstring, RegDate, GetIP(playerid));
mysql_query(query1);
Logged[playerid] = 1;
WindowForPlayer(playerid, "You are now ~r~registered ~w~to Battlefield War Heroes! Enjoy playing!");
WelcomeDialog(playerid);
new echo[130];
new kname[24];
GetPlayerName(playerid, kname, 24);
format(echo,sizeof(echo),"0,3** System: %s (%d) (IP: %s) has registered a new account",pname,playerid,GetIP(playerid));
IRC_GroupSay(gGroupID, IRC_ACHANNEL, echo);
new admin[128];
format(admin,sizeof(admin),"** System: %s (%d) (%s) has registered a new account.",pname,playerid,GetIP(playerid));
SendMessageToAdmins(LIGHTBLUE,admin);
new txd[128];
format(txd,sizeof(txd),"%s (%d) (IP: %s) registered a new account",pname,playerid,GetIP(playerid));
TextDrawSetString(RegTxd, txd);
new welcome[130];
format(welcome, sizeof(welcome), "Welcome to Battlefield War Heroes, ~r~%s! Type ~r~/rules ~w~and ~r~/cmds ~w~for server info.",pname);
GameTextForPlayer(playerid,welcome,6000,4);
return 1;
}
Quote:
[21:11:20] [21:11:20] --------------------------- [21:11:20] MySQL Debugging activated (01/01/14) [21:11:20] --------------------------- [21:11:20] [21:11:44] >> mysql_query( Connection handle: 1 ) [21:11:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:11:44] >> mysql_store_result( Connection handle: 1 ) [21:11:44] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [21:11:44] >> mysql_num_rows( Connection handle: 1 ) [21:11:44] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [21:11:44] >> mysql_fetch_row_format( Connection handle: 1 ) [21:11:44] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Connection is dead) [21:11:44] >> mysql_query( Connection handle: 1 ) [21:11:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:11:44] >> mysql_free_result( Connection handle: 1 ) [21:11:44] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [21:11:44] >> mysql_query( Connection handle: 1 ) [21:11:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:11:44] >> mysql_store_result( Connection handle: 1 ) [21:11:44] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [21:11:44] >> mysql_num_rows( Connection handle: 1 ) [21:11:44] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [21:11:44] >> mysql_free_result( Connection handle: 1 ) [21:11:44] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [21:11:52] >> mysql_query( Connection handle: 1 ) [21:11:52] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:11:59] >> mysql_query( Connection handle: 1 ) [21:11:59] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:12:44] >> mysql_query( Connection handle: 1 ) [21:12:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:12:44] >> mysql_store_result( Connection handle: 1 ) [21:12:44] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [21:12:44] >> mysql_num_rows( Connection handle: 1 ) [21:12:44] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [21:12:44] >> mysql_fetch_row_format( Connection handle: 1 ) [21:12:44] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Connection is dead) [21:12:44] >> mysql_query( Connection handle: 1 ) [21:12:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:12:44] >> mysql_free_result( Connection handle: 1 ) [21:12:44] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [21:12:44] >> mysql_query( Connection handle: 1 ) [21:12:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:12:44] >> mysql_store_result( Connection handle: 1 ) [21:12:44] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [21:12:44] >> mysql_num_rows( Connection handle: 1 ) [21:12:44] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [21:12:44] >> mysql_free_result( Connection handle: 1 ) [21:12:44] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [21:12:52] >> mysql_query( Connection handle: 1 ) [21:12:52] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [21:12:53] >> mysql_query( Connection handle: 1 ) [21:12:53] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) |