21.03.2016, 17:57
I am trying to create a register system with mySQL, how would I split up my formats?
This is original:
The only way I can think, but doesn't work or insert data is:
Would I have to use two queries?
Original:
New:
This is original:
pawn Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Caps`, `PosX`, `PosY`, `PosZ`, `PosA`, `Health, `Armour`, `Skin`, `Thirst`, `Hunger`, `Banned`, `Bans`, `Kicks`, `Warns`, `Muted`, `Quests`, `TimeH`, `TimeM`, `Infection`, `Storage`, `Item1`, `Item2`, `Item3`, `Item4`, `Item5`, `Item6`, `Item7`, `Item8`, `Item9`, `Item10`)) VALUES ('%e', '%e', '%e', 0, 0, 0, %f, %f, %f, %f, 100, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", playername, Player[playerid][Password], playerip, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_A);
pawn Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Caps`, `PosX`, `PosY`, `PosZ`, `PosA`, `Health, `Armour`, `Skin`, `Thirst`, `Hunger`, `Banned`, `Bans`, `Kicks`, `Warns`, `Muted`, `Quests`) VALUES ('%e', '%e', '%e', 0, 0, 0, %f, %f, %f, %f, 100, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0)", playername, Player[playerid][Password], playerip, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_A);
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`TimeH`, `TimeM`, `Infection`, `Storage`, `Item1`, `Item2`, `Item3`, `Item4`, `Item5`, `Item6`, `Item7`, `Item8`, `Item9`, `Item10`) VALUES (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
Original:
pawn Код:
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
pawn Код:
mysql_tquery(mysql, query1, "", "i", playerid);
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);