Mysql tquery loop only loading once
#5

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
You are using "sizeof(szRows)" within the loop. The loop only runs once because using "sizeof" with a non-array variable returns 1, so try changing:

pawn Код:
for(new i = 0; i < sizeof(szRows); i++)
To:

pawn Код:
for (new i = 0; i < szRows; i ++)
Ahh finally, wonderful! Thank you so much Emmet.

Edit:
Noticed when it done the "Loaded faction:" print that it loaded the same faction for X amount of rows, instead of the next faction. Although it loaded the next ID.

Example, I have in my database:
Код:
factionid factionname
12 Corrupt
11 Fire Department
10 Health Department
Print:
Код:
Loaded faction: Corrupt (12)
Loaded faction: Corrupt (11)
Loaded faction: Corrupt (10)
Edit again:
Nevermind, made a blonde mistake, noticed I was loading row 0 instead of 'i' for most of the information. *facepalm*
Reply


Messages In This Thread
Mysql tquery loop only loading once - by Jack_Leslie - 07.07.2014, 05:11
Re: Mysql tquery loop only loading once - by Vince - 07.07.2014, 08:23
Re: Mysql tquery loop only loading once - by Jack_Leslie - 07.07.2014, 08:42
Re: Mysql tquery loop only loading once - by Emmet_ - 07.07.2014, 09:10
Re: Mysql tquery loop only loading once - by Jack_Leslie - 07.07.2014, 09:11
Re: Mysql tquery loop only loading once - by Vince - 07.07.2014, 09:14
Re: Mysql tquery loop only loading once - by Jack_Leslie - 07.07.2014, 09:17

Forum Jump:


Users browsing this thread: 1 Guest(s)