22.03.2016, 13:45
pawn Код:
// under DIALOG_REGISTER
mysql_format(SQL, Query, sizeof(Query), "INSERT INTO `Accounts` (`Username`, `Password`) VALUES ('%e', '%e')", GetNameWithUnderscore(playerid), Player[playerid][Password]);
mysql_tquery(SQL, Query, "OnPlayerRegisterAccount", "i", playerid);
pawn Код:
public OnPlayerRegisterAccount(playerid)
{
Player[playerid][DatabaseID] = cache_insert_id();
printf("[SQL] New account registered. Database ID: [%d]", cache_insert_id());
new pIP[16], Query[255];
GetPlayerIp(playerid, pIP, sizeof(pIP));
mysql_format(SQL, Query, sizeof(Query), "UPDATE `accounts` SET `RegisterIP` = %s, \
WHERE `DatabaseID` = %d", pIP, Player[playerid][DatabaseID]); // I'm also getting a MYSQL error here
mysql_tquery(SQL, Query, "", "");
AdvanceTutorial(playerid, 1);
return 1;
}
Halp pls (REP+)