15.03.2018, 22:25
I see. I thought the info was supposed to be loaded right in the loop.
However, the check I mentioned is still not correct. You need to declare two variables before the loop, something like "highestid" and "highestlevel".
Inside the loop, you compare the Level of the current Account with the highestlevel variable.
If higher, set highestid to the current id and highestlevel to the level of that account.
When the loop finished, highestid and highestlevel will be filled with the data of the highest level account.
Still, you should think about SQL or MySQL. That will get rid of the Accounts limit and finding out data like this is a lot easier.
However, the check I mentioned is still not correct. You need to declare two variables before the loop, something like "highestid" and "highestlevel".
Inside the loop, you compare the Level of the current Account with the highestlevel variable.
If higher, set highestid to the current id and highestlevel to the level of that account.
When the loop finished, highestid and highestlevel will be filled with the data of the highest level account.
Still, you should think about SQL or MySQL. That will get rid of the Accounts limit and finding out data like this is a lot easier.