07.10.2015, 20:12
BroZeus since i have to place your code inside the registration callback i edited a bit:
Seems the TotalAccounts row is not updating:
Код:
new stats[128]; mysql_format(mConnectionHandle, stats, sizeof(stats), "UPDATE ServerStats SET TotalAccounts = TotalAccounts + 1"); mysql_tquery(mConnectionHandle, stats); mysql_tquery(mConnectionHandle, "SELECT TotalAccounts FROM ServerStats"); new name[24]; GetPlayerName(playerid, name, sizeof(name)); format(irc,sizeof(irc),"1,3%s (%d) has registered a new account. Total accounts registered: %d",name,playerid,cache_get_row_int(0, 0, mConnectionHandle)); IRC_GroupSay(groupID, IRC_CHANNEL, irc); IRC_GroupSay(groupID, IRC_ACHANNEL, irc);
Quote:
16:13:17] [DEBUG] mysql_format - connection: 0, len: 128, format: "UPDATE ServerStats SET TotalAccounts = TotalAccounts + 1" [16:13:17] [ERROR] mysql_format - invalid connection handle (id: 0) [16:13:17] [DEBUG] mysql_tquery - connection: 0, query: "", callback: "(null)", format: "(null)" [16:13:17] [ERROR] mysql_tquery - invalid connection handle (id: 0) [16:13:17] [DEBUG] mysql_tquery - connection: 0, query: "SELECT TotalAccounts FROM ServerStats", callback: "(null)", format: "(null)" [16:13:17] [ERROR] mysql_tquery - invalid connection handle (id: 0) [16:13:17] [DEBUG] cache_get_row_int - row: 0, field_idx: 0, connection: 0 |