10.12.2014, 20:45
Hi all,
I have a players table inside sqlite with the column id - PK NN AI.
I use db_get_field_assoc() to get the id value using my query result variable and set it to my players variable, like so:
Now come the tricky part, i want to debug the value so I call:
Why in the world is the printf function returning 49?
That's more interesting, if the id in the database is 2, it returns 50 from the printf function, and if the id is 10 it returns 59, but the print function always returns the right value.
Why is that Thanks for the help...
I have a players table inside sqlite with the column id - PK NN AI.
I use db_get_field_assoc() to get the id value using my query result variable and set it to my players variable, like so:
Код:
enum playersInfo { pid } new players[MAX_PLAYERS][playersInfo]; // ... // ... if (db_num_rows(result) == 1) { db_get_field_assoc(result, "id", players[playerid][pid], 11); }
Код:
print(players[playerid][pid]); // prints 1, that's the correct id. printf("id: %d\n", players[playerid][pid]); // prints id: 49 ... wth???
That's more interesting, if the id in the database is 2, it returns 50 from the printf function, and if the id is 10 it returns 59, but the print function always returns the right value.
Why is that Thanks for the help...