SQL syntax error
#1

pawn Код:
format(Query,sizeof(Query),"INSERT INTO `Accounts` (Username,Password,IP,Money,Level,AdminLevel,Faction,FactionRank,RegistrationStep,BirthDay,BirthMonth,BirthYear,SpawnPoint,TutorialComplete,HelperLevel,Accent,MinutesPlayed,AchievementPoints,ExperiencePoints,DonatorLevel,Deaths,Kills,Clothes1,Clothes2,Clothes3,ClothesUsed,CarLicense,HouseKey), VALUES('%s','%s','%s','500','1','0','0','0','0','0','0','0','0','0','0','None','0','0','0','0','0','0','0','0','0','0','0','0')",
                pName(playerid),inputtext,GetIP(playerid));
                mysql_query(Query);
                mysql_store_result();
                mysql_free_result();
                format(Query,sizeof(Query),"INSERT INTO `Accounts` (Business1Key,Business2Key), VALUES('0','0')");
                mysql_query(Query);
                mysql_store_result();
                mysql_free_result();

It doesn't work, it shows "
Код:
[08:27:57] 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('0','0')' at line 1 -1 -1 NULL INSERT INTO `Accounts` (Business1Key,Business2Key), VALUES('0','0') 1
[08:27:57] 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('Danny_Kovalchuk','lolnoob','75.118.152.108','500','1','0','0','0','0','' at line 1 -1 -1 NULL INSERT INTO `Accounts` (Username,Password,IP,Money,Level,AdminLevel,Faction,FactionRank,RegistrationStep,BirthDay,BirthMonth,BirthYear,SpawnPoint,TutorialComplete,HelperLevel,Accent,MinutesPlayed,AchievementPoints,ExperiencePoints,DonatorLevel,Deaths,Kills,Clothes1,Clothes2,Clothes3,ClothesUsed,CarLicense,HouseKey), VALUES('Danny_Kovalchuk','password','127.0.0.1','500','1','0','0','0','0','0','0','0','0','0','0','None','0','0','0','0','0','0','0','0','0','0','0','0') 1
How can I change it?
Reply
#2

Remove the comma before "VALUES" in both queries
INSERT INTO `Accounts` (Business1Key,Business2Key), VALUES('0','0')

Edit: Remove the store & free result for those queries
Reply
#3

Now it creates two accounts.

One is "My_Name" the next is a blank name.
Reply
#4

Thanks for putting my name here.
Reply
#5

Quote:
Originally Posted by dannyk0ed
Посмотреть сообщение
Thanks for putting my name here.
Welcome, thanks for the off-topic. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)