Something breaks the loop.
#1

It's actually a very simple for(new i; i < ...; i++) loop but something inside is breaking it in a very strange location. As you can see, I did some debugging and the results are here: http://i.imgur.com/HgJL1Dz.png. The SQL plugin used here is Dan's but I think this doesn't matter much. Any help would be appreciated.
PHP код:
printf("rows: %i"rows);
for (new 
isizeof(rows); i++)
{
    print(
"1");
    
sql_get_field_assoc(r"aeg"result24);
    print(
"2");
    
sql_get_field_assoc(r"kestvus"kkestvus16);
    print(
"3");
    
format(resultsizeof(result), "%i - %s - %s"sql_get_field_assoc_int(r"helistaja"), resultkkestvus);
        print(
"4");
    
format(stringsizeof(string), "%s%s\n"stringresult);
    print(
"5");
    
sql_next_row(r);
    print(
"6");
}
ShowPlayerDialog(playeridDIALOG_KONELOGIDIALOG_STYLE_LISTCOL_WHITE"Telefon"string"Vali""Tagasi"); 
Reply
#2

rows is an integer, not an array to use sizeof. No matter what its value, it will always return one; hence it's called only once (the loop).

Change to:
pawn Код:
for (new i; i < rows; i++)
Reply
#3

Ahh, damn... I really didn't notice that. I have made so many stupid mistakes recently
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)