MySQL Formats
#1

I am trying to create a register system with mySQL, how would I split up my formats?

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);
The only way I can think, but doesn't work or insert data is:

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)");
Would I have to use two queries?

Original:

pawn Код:
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
New:

pawn Код:
mysql_tquery(mysql, query1, "", "i", playerid);
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
Reply


Messages In This Thread
MySQL Formats - by theonethatownz - 21.03.2016, 17:57
Re: MySQL Formats - by SickAttack - 21.03.2016, 18:13
Re: MySQL Formats - by zPain - 21.03.2016, 18:27
Re: MySQL Formats - by theonethatownz - 21.03.2016, 18:39
Re: MySQL Formats - by zPain - 21.03.2016, 18:49
Re: MySQL Formats - by theonethatownz - 21.03.2016, 19:10
Re: MySQL Formats - by Konstantinos - 22.03.2016, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)