Mysql Error
#1

Код:
[13:06:26] CMySQLHandler::Query(INSERT INTO playerdata (user, password, score, money, IP, admin, skin, health, armor, xchord, ychord, zchord, virtualw, interior) VALUES('Fleming', SHA1('test'),0, 0, '127.0.0.1', 0, 0, 100, 0, 1) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
Code:

Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query[200], pname[24], IP[16];
    GetPlayerName(playerid, pname, 24);
    GetPlayerIp(playerid, IP, 16);
    SetPlayerHealth(playerid,100);
    format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, IP, admin, skin, health, armor, xchord, ychord, zchord, virtualw, interior) VALUES('%s', SHA1('%s'),0, 0, '%s', 0, 0, 100, 0, 1958, 1343, 15, 0, 0,0)", pname, passwordstring, IP);
    mysql_query(query);
    SendClientMessage(playerid, -1, "You have been registered on this server!");
    Logged[playerid] = 1; 
    return 1;
}
Reply
#2

Try this...

pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query[500], pname[24], IP[16];
    GetPlayerName(playerid, pname, 24);
    GetPlayerIp(playerid, IP, 16);
    SetPlayerHealth(playerid,100);
    format(query, sizeof(query), "INSERT INTO playerdata (user, password, score, money, IP, admin, skin, health, armor, xchord, ychord, zchord, virtualw, interior) VALUES('%s', SHA1('%s'),0, 0, '%s', 0, 0, 100, 0, 1958, 1343, 15, 0, 0,0)", pname, passwordstring, IP);
    mysql_query(query);
    SendClientMessage(playerid, -1, "You have been registered on this server!");
    Logged[playerid] = 1;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)