SQL crashing
#4

Quote:
Originally Posted by Alexis1999
Посмотреть сообщение
Thanks for replying. Although I'm pretty sure all the variables used to get from db_get_field_assoc have a defined value.

Here take a look.

Creating the table
pawn Код:
db_query(Database, "CREATE TABLE IF NOT EXISTS `ACCOUNTS` (`NAME`, `PASSWORD`, `MONEY` `FACTION`, `LEVEL`, `ADMINLEVEL`, `HELPER`, `DONATOR`, `MODERATOR`, `FRANK`, `SKIN`, `GENDER`, `AGE`)");
Inserting Values
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `ACCOUNTS` (`NAME`, `PASSWORD`, `MONEY`, `FACTION`, `LEVEL`, `ADMINLEVEL`, `HELPER`, `DONATOR`, `MODERATOR`, `FRANK`) VALUES('%s', '%s', '4000', '-1', '0', '0', '0', '0', '0', '0')", DB_Escape(sCzName), DB_Escape(inputtext));
Money variable is defined above.

And for the skin, gender and age variables
pawn Код:
format(Query, sizeof(Query), "update `ACCOUNTS` set `SKIN` = '%i' where `NAME` = '%s'", DB_Escape(SkinID[playerid]), szName);
format(Query, sizeof(Query), "UPDATE `ACCOUNTS` SET `AGE` = '%i' WHERE `NAME` = '%s' AND SET `GENDER` = '%s' WHERE `NAME` = '%s'", DB_Escape(AgeID[playerid]), szName, DB_Escape(GenderID), szName);
The problem only appeared when I attempted to grab those values from the DB.
pawn Код:
format(Query, sizeof(Query), "UPDATE `ACCOUNTS` SET AGE = '%d', GENDER = '%d' WHERE `NAME` = '%s'", DB_Escape(AgeID[playerid]), DB_Escape(GenderID), szName);
Try this.
Reply


Messages In This Thread
SQL crashing - by Alexis1999 - 19.08.2013, 21:48
Re: SQL crashing - by Stylock - 20.08.2013, 20:14
Re: SQL crashing - by Alexis1999 - 20.08.2013, 20:27
Re: SQL crashing - by Cypress - 20.08.2013, 20:49
Re: SQL crashing - by Stylock - 20.08.2013, 20:59
Re: SQL crashing - by Alexis1999 - 20.08.2013, 21:36

Forum Jump:


Users browsing this thread: 1 Guest(s)