How to save IP into mysql database
I have pInfo IP. And SaveAccount function where all things are saved into mysql. So , What should I use? Varchar, Int ? Lengh ? %d or %s ? |
new plrIP[16]; PlayerInfo[playerid][pIP] = GetPlayerIp(playerid, plrIP, sizeof(plrIP));
UPDATE blabla, IP='%s' WHERE Name='%s'",
new Query[128], pIP[17], pName[23];
GetPlayerIp(playerid, pIP, sizeof(pIP));
GetPlayerName(playerid, pName, sizeof(pName));
format(Query, sizeof(Query), "UPDATE `Accounts` SET `PlayerIP` = '%s' WHERE `Username` = '%s'", pIP, pName);
mysql_query(Query);
new ConnectIP[16]; GetPlayerIp(playerid, ConnectIP, sizeof(ConnectIP)); if(ConnectIP == PlayerInfo[playerid][pIP]) { LoginPlayer(playerid); { else(AccountExists[playerid] == 1) { ShowPlayerDialog(playerid, LOGIND, DIALOG_STYLE_INPUT, "Login", "Please insert password to login", "Login", "Cancel"); } else { SendClientMessage(playerid, COLOR_ORANGE, "Registred"); ShowPlayerDialog(playerid, REGISTERD, DIALOG_STYLE_INPUT, " Register", "Please insert password to register an account", "Register", "Cancel"); }
new ConnectIP[16];
GetPlayerIp(playerid, ConnectIP, sizeof(ConnectIP));
if(ConnectIP == PlayerInfo[playerid][pIP]) LoginPlayer(playerid);
else if(AccountExists[playerid] == 1) ShowPlayerDialog(playerid, LOGIND, DIALOG_STYLE_INPUT, "Login", "Please insert password to login", "Login", "Cancel");
else SendClientMessage(playerid, COLOR_ORANGE, "Registred"),
ShowPlayerDialog(playerid, REGISTERD, DIALOG_STYLE_INPUT, " Register", "Please insert password to register an account", "Register", "Cancel");
(2334) : error 033: array must be indexed (variable "ConnectIP") (2334) : warning 202: number of arguments does not match definition (2343) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
2334: if(ConnectIP == PlayerInfo[playerid][pIP]) LoginPlayer(playerid);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Please insert password to login", "Login", "Cancel"); { else // 2343 } SendClientMessage(playerid, COLOR_ORANGE, "------------------------------------------------------");
Код:
(2334) : error 033: array must be indexed (variable "ConnectIP") (2334) : warning 202: number of arguments does not match definition (2343) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. Код:
2334: if(ConnectIP == PlayerInfo[playerid][pIP]) LoginPlayer(playerid); Код:
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Please insert password to login", "Login", "Cancel"); { else // 2343 } SendClientMessage(playerid, COLOR_ORANGE, "------------------------------------------------------"); |