Yet another MSQL Problem..
#1

Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query[500], pname[24], IP[16];
    GetPlayerName(playerid, pname, 24);
    GetPlayerIp(playerid, IP, 16);
    format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, IP,admin,faction,leader,cuffed,badge,accent,gender,skin,xchord, ychord, zchord,health,armor) VALUES('%s', SHA1('%s'),0, 0, '%s',0,0,0,0,0,0,0,299,1714,-1882,14,100,0)", pname, passwordstring, IP);
    mysql_query(query);
    SendClientMessage(playerid, -1, "You have been registered on this server!");
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Gender", "Male\nFemale", "Select", "");
    Logged[playerid] = 1; 
    return 1;
}
And im receiving the following error:

Код:
[04:07:35] CMySQLHandler::Query(INSERT INTO playerdata (user, password, score, money, IP,admin,faction,leader,cuffed,badge,accent,gender,skin,xchord, ychord, zchord,health,armor) VALUES('Nestea', SHA1('test'),0, 0, '127.0.0.1',0,0,0,0,0,0,0,0,299,1714,-1882,14,100,0)) - An error has occured. (Error ID: 1136, Column count doesn't match value count at row 1)
Reply
#2

You are giving it 1 too many values, you specify 18 colums and 19 values.
Код:
INSERT INTO playerdata (user, password, score, money, IP,admin,faction,leader,cuffed,badge,accent,gender,skin,xchord, ychord, zchord,health,armor) VALUES('%s', SHA1('%s'),0, 0, '%s',0,0,0,0,0,0,0,299,1714,-1882,14,100,0)
Should be:
Код:
INSERT INTO playerdata (user, password, score, money, IP,admin,faction,leader,cuffed,badge,accent,gender,skin,xchord, ychord, zchord,health,armor) VALUES('%s', SHA1('%s'),0, 0, '%s',0,0,0,0,0,0,299,1714,-1882,14,100,0)
I think i removed the right value, it was between the IP and SKIN ID columns.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)