19.05.2015, 23:32
I am having trouble again, This time i cannot figure it out as this line is pretty much of long.
I believe it is a missing "," but i have checked it ~ Can't seem to find anything wrong on the code.
Код:
[07:37:25] CMySQLHandler::Query(VALUES('Sara_Washington', SHA1('ilovexenia'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, '192.168.1.100', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) - 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 'VALUES('Sara_Washington', SHA1('ilovexenia'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0,' at line 1)
PHP код:
MySQL_Register(playerid, passwordstring[])
{
new query1[750], string[2000];
strcat(string, "INSERT INTO `players` (`username`, `password`, `age`, `sex`, `skin`, `regsteps`, `level`, `cash`, `helper`, `tester`, `admin`, `donor`, `posx`, `posy`, `posz`, `posa`, `posvw`, `posint`, `IP`, `gun0`, `gun1`, `gun2`, `gun3`, `gun4`, `gun5`, `gun6`, `gun7`, `gun8`, `gun9`, `gun10`, `gun11`, `ammo0`, `ammo1`, `ammo2`, `ammo3`, `ammo3`, `ammo4`, `ammo5`, `ammo6`, `ammo7`, `ammo8`, `ammo9`, `ammo10`, `ammo11`) ");
format(query1, 750, "VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", GetName(playerid), passwordstring, pInfo[playerid][pIP]);
strcat(string, query1);
mysql_query(query1);
pInfo[playerid][pSkin] = 0;
pInfo[playerid][pLevel] = 1;
pInfo[playerid][pRegisterSteps] = 1;
SendClientMessage(playerid, -1, "You have been registered to International Roleplay (Saved in to our SQL database)");
SetSpawnInfo(playerid, NO_TEAM, pInfo[playerid][pSkin], pInfo[playerid][pPos][0], pInfo[playerid][pPos][1], pInfo[playerid][pPos][2], pInfo[playerid][pPos][3], 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
pInfo[playerid][pLogged] = 1;
return 1;
}