Saving problem
#1

Hi all, I have a problem with data updating.

Saving data function looks like this

pawn Код:
new PlayerIP[24];
GetPlayerIp(playerid, PlayerIP, sizeof (PlayerIP)); //Players IP
format(Query, sizeof(Query), "UPDATE `Accounts` SET  `IP Address` = '%s' WHERE `Username` = '%s'",PlayerIP,GetEscName(playerid));

Server log: [16:02:30] CMySQLHandler::Query(UPDATE `Accounts` SET `IP Address` = '255.255.255.255' WHERE `Username` = 'Player') - Successfully executed.

My ip address is not like this '255.255.255.255'

thanks for help
Reply
#2

Help D:
Reply
#3

i dont see anything wrong with the code
Did you look up ur IP first ?
But your right your IP cant be 255.255.255.255

try this out
EDIT
pawn Код:
new rip[MAX_PLAYERS][16]; GetPlayerIp(playerid,rip[playerid],16);
format(Query, sizeof(Query), "UPDATE `Accounts` SET  `IP Address` = '%s' WHERE `Username` = '%s'",rip[playerid],GetEscName(playerid));
Reply
#4

Still don't work but, when i put this line in register line it's works fain
BTW not your line, when put this my line
pawn Код:
new PlayerIP[24];
GetPlayerIp(playerid, PlayerIP, sizeof (PlayerIP)); //Players IP
format(Query, sizeof(Query), "UPDATE `Accounts` SET  `IP Address` = '%s' WHERE `Username` = '%s'",PlayerIP,GetEscName(playerid));
Reply
#5

try using a different name for the format instead of Query
Do like Query2 or something else it might be used before :X
Reply
#6

I do like you say, but same
Reply
#7

so your saying if you put this function somewhere else it works fine ?
but not where it is now ?

if that is so can u shows more of the code to see what could be the cause
And btw 255.255.255.0 is a IPv4 Subnet Mask: IP how does it get that i dont know xd
Reply
#8

In register process example:

pawn Код:
if(!response)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "This question is mandatory, come back and fill it in!");
                Kick(playerid);
            }
            else if(strlen(inputtext) < 4 || strlen(inputtext) > 48)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "We can't accept your question. It must be longer then 4 characters, but no more then 48.");
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Security Question - Step 1", "What would you like your security question to be?", "Submit", "Leave");
            }
            else
            {
                new string[128], esc_inputtext[48];
                format(string, sizeof(string), "You have entered; \"%s\" as your security question. Is this correct?", inputtext);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

                mysql_real_escape_string(inputtext, esc_inputtext);
                format(Query, sizeof(Query), "UPDATE `Accounts` SET `Security Question` = '%s' WHERE `Username` = '%s'", esc_inputtext, GetName(playerid));
                mysql_query(Query);
// here i put and works
pawn Код:
GetPlayerIp(playerid, pStats[playerid][pIPAddress], 17);
        format(Query, sizeof(Query), "UPDATE `Accounts` SET `IP Address` = '%s' WHERE `Username` = '%s'",  pStats[playerid][pIPAddress], GetName(playerid));
        mysql_query(Query); //Queries
pawn Код:
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Security Question - Step 1 (confirmation)", "Yes, continue.\nNo, try again.", "Submit", "Leave");
            }
        }


when i put here, result
pawn Код:
[19:50:10] CMySQLHandler::Query(UPDATE `Accounts` SET `IP Address` = '127.0.0.1' WHERE `Username` = 'Player') - Successfully executed.
Works Good
Reply
#9

please help
Reply
#10

Bomm
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)