new query[50],pass[50],pName[50]; GetPlayerName(playerid,pName,30); mysql_real_escape_string(inputtext,pass); format(query,sizeof(query),"INSERT INTO Users SET Username='%s',Password='%s',Money=10000",pName,pass); mysql_query(query); SendClientMessage(playerid,COLOR_YELLOW,"Successfully Registered"); GivePlayerMoney(playerid,10000);
[13:17:45] CMySQLHandler::Query(INSERT INTO Users SET Username='Ron_Killings',Pas) - 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)
format(query,sizeof(query),"INSERT INTO Users VALUES ('%s','%s',1000)",pName,pass);
[13:29:10] CMySQLHandler::Query(INSERT INTO Users VALUES('Ron_Killings','main',10) - 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)
new query[50],pass[50],pName[50];
GetPlayerName(playerid,pName,30);
mysql_real_escape_string(inputtext,pass);
format(query,sizeof(query),"INSERT INTO Users SET Username='%s',Password='%s',Money='10000'",pName,pass);
mysql_query(query);
SendClientMessage(playerid,COLOR_YELLOW,"Successfully Registered");
GivePlayerMoney(playerid,10000);
Try this!
pawn Код:
|
[13:35:16] CMySQLHandler::Query(INSERT INTO Users SET Username='Ron_Killings',Pas) - 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)
INSERT INTO `users` (Username, Password) VALUES ('%s', '%s')", pName, pass);
|
[13:43:30] CMySQLHandler::Query(INSERT INTO `users` (Username, Password) VALUES () - 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)
That's because your query string lenght is too small.. Make it begger
|
format(query,sizeof(query),"INSERT INTO `Users` (Username,Password,Money) VALUES ('%s','%s','1000')",pName,pass);
format(query,sizeof(query),"INSERT INTO `Users` (Username,Password,Money) VALUES ('%s','%s',1000)",pName,pass);