Currently I have an issue with my plugin, everything is good with my floating text feature... however I'm not sure how to properly display top 10 players from a chosen table with the corresponding stats. Ex. 1. Joe > $100 2. Mc > $71 (etcetc...) But with my code, only the first player is displayed. Ex. 1. Joe > $100 (nothing else) I have no clue how to fix this, I've been trying to solve this for a while now. PHP: public function topBalance(string $player){ $query=$this->db->query("SELECT * FROM economy ORDER BY balance DESC LIMIT 10;"); $list=""; $i=0; while($resultArr=$query->fetchArray(SQLITE3_ASSOC)){ $j=$i + 1; $cf=$resultArr['player']; $b=$this->getBalance($cf); $list.=$j.". ".$cf." > $".$b."\n"; $i=$i + 1; return $list; } }
Your return statement is inside the loop, so your loop will be exited immediately after the first run.
Bruh thank u so much, I genuinely dont know how I could be trippin over the smallest thing. I aint even realize that return was in the loop.