Lots of errors on SQLite..
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You have used "field_assoc", that means that the second parameter is the name of the field but you can retrieve the last inserted ID using the field functions. The second parameter is 0 (for fieldid) but since there are no more selected, it's 0 by default:
pawn Код:
User[playerid][P_ID] = db_get_field_int(Result);
---

pawn Код:
User[playerid][P_ID] = db_get_field_assoc_int(Result, "userid", P_ID, sizeof P_ID); //2 Errors on Line 163
User[playerid][P_RANK] = db_get_field_assoc_int(Result, "admin", P_RANK, sizeof P_RANK); //2 Errors on Line 164
P_ID and P_RANK are constants used in the enumerator and actually there's no reason to try get the size (which you would have to manually specify it) as they're not strings. That would be:
pawn Код:
User[playerid][P_ID] = db_get_field_assoc_int(Result, "userid");
User[playerid][P_RANK] = db_get_field_assoc_int(Result, "admin");


It's correct and it is used to avoid calling strlen twice.
Thank you sir. Fixed my errors! Much appreciated!
Reply


Messages In This Thread
[SOLVED] Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 09:13
Re: Lots of errors on SQLite.. - by K0P - 19.06.2016, 09:20
Re: Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 09:24
Re: Lots of errors on SQLite.. - by SyS - 19.06.2016, 09:32
Re: Lots of errors on SQLite.. - by Konstantinos - 19.06.2016, 13:13
Re: Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 16:04
Re: Lots of errors on SQLite.. - by SyS - 22.06.2016, 02:40

Forum Jump:


Users browsing this thread: 2 Guest(s)