14.08.2011, 02:50
You cannot get a whole line at once using a SQLite function but you can make one. I'll give you a example
I really don't see why you would want to though.
You could do something like this
pawn Код:
#define MAX_RET_STR 500
stock db_get_row(query[])
{
new DBResult:Result, retstr[MAX_RET_STR], FieldName[50], singleresult[100];
Result = db_query(query);
new numfields = db_num_fields(Result);
for(new a;a<numfields;a++)
{
db_field_name(Result, a, FieldName, 50);
db_get_field_assoc(Result, FieldName, singleresult, 100);
format(retstr, sizeof(retstr), "%s|%s", retstr, singleresult);
}
return retstr[1];
}
pawn Код:
User|Pass|Kills|Deaths|etc..
//Will return
[HiC]TheKiller|MyPass|20|30|etc..
You could do something like this
pawn Код:
new Line[750];
format(Line, 750, "%s", db_get_row("SELECT * FROM userdata WHERE username = '[HiC]TheKiller'"));
sscanf(Line, "....", .....);