SA-MP Forums Archive
MYSQL loading rows skips first row - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL loading rows skips first row (/showthread.php?tid=559800)



MYSQL loading rows skips first row - zaibaslr2 - 25.01.2015

Hi,
I'm loading multiple rows:
pawn Код:
new Result:c = sql_query(sql,"SELECT * FROM pastatai WHERE SklypoID = 0",QUERY_CACHED);
    while(sql_next_row(c))
    {
        printf("Object Found, PastatoID = %d",sql_get_field_assoc_int(c,"PastatoID"));
    }
My database:

But the script starts printing from second row, skipping first one. What do I have to do to make it count first row too?


Re: MYSQL loading rows skips first row - Lordzy - 25.01.2015

I suppose sql_next_row jumps to the next row of the retrieved data. If that isn't, which MySQL plugin are you using?


Re: MYSQL loading rows skips first row - zaibaslr2 - 25.01.2015

https://sampforum.blast.hk/showthread.php?tid=429464 This one.