31.05.2014, 14:24
Okay, I've been using MySQL for nearly a month but the syntax still throws me. When a player registers it gives out the following error:
The query I'm trying to execute...
I know it's messy... It worked up until now.
Any help is appreciated
pawn Код:
[ERROR] CMySQLQuery::Execute[] - (error #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
pawn Код:
mysql_format(MySQL, query, sizeof(query), "INSERT INTO `accounts` (Username, Password, Money, Score, posX, posY, posZ, Admin, Skin, Age, Sex, Interior, VirtualWorld, CellNum, Job, Accent, Faction, Hospital, Insurance, Title, TitleEnabled, Developer, VIP, Credits, Banned, BannedBy, Reason, Ip) \
VALUES ('%s', %i, %i, %i, %f, %f, %f, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d, '%s', '%s', '%s')",
name, //Username
udb_hash(inputtext), //Password
200, //Cash
0, //Score
x, // posX
y, // posY
z, // posZ
0, //Admin check.
0, //Skin
23, //Age
0, //Gender (Male)
0, //Interior
0, //VirtualWorld
0, //Cellnum
0, //Job
0, //Accent
255, //INVALID_FACTION_ID
0, //Hospital
0, //Insurance
blankstring, //Blank title
0, //Title Enabled
0, //Developer Status
0, //VIP Status
0, //Credits
0, //Banned is 0.. Obviously
blankstring, //BannedBy
blankstring, //reason
blankstring //IP, blank because it will be assigned when player logs in.
);
Any help is appreciated