19.01.2013, 08:12
You need to loop through the rows.
That will probably need editing to work with your code.
EDIT: Also probably not the best idea to load values from a database, then use them as an index to an array without bounds checking. That could lead to serious problems. Unless your absolutely sure it wont go out of bounds.
pawn Код:
while( db_num_rows(qResult) )
{
new Field[128];
db_get_field_assoc(qResult, "ID", Field, 12);
new i = strval(Field);
db_get_field_assoc(qResult, "Name", Field, 32);
strmid(gInfo[i][gName],Field,0,32);
db_get_field_assoc(qResult, "Members", Field, 12);
gInfo[i][gMembers] = strval(Field);
db_get_field_assoc(qResult, "Color", Field, 32);
strmid(gInfo[i][gColor],Field,0,32);
db_get_field_assoc(qResult, "Leader", Field, MAX_PLAYER_NAME);
printf("%s",Field);
db_next_row(qResult);//move on to next row
}
db_free_result(qResult);
EDIT: Also probably not the best idea to load values from a database, then use them as an index to an array without bounds checking. That could lead to serious problems. Unless your absolutely sure it wont go out of bounds.