Reply to thread

This is a code to fetch badges for a staff page but the problem I have is it doesnt choose the 5 Im wearing, it chooses 1 or 2 of them and displays that badge, 2 or 3 times so for example, Im wearing 5 different badges but on staff page, badge 1 is showing up twice and badge 2 is showing up 3 times, can anyone help?

[PHP]$query_badges = Core::$DB->prepare("SELECT * FROM user_badges WHERE user_id = '".$rank_user['id']."' AND badge_slot > 0 ORDER BY badge_slot LIMIT 5")->execute();

                if($query_badges->num_rows == 0)

                {   

                    self::$staff_containers = self::$staff_containers.'<div><i><ubuntu>'.Template::$language['have_no_badges'].'</ubuntu></i></div>';

                }


                while($badges = $query_badges->fetch_assoc()){

                    self::$staff_containers = self::$staff_containers.'<img style="margin-top: -5px; margin-bottom: 5px; margin-right: 10px; float: left;" src="'.Core::$Config['badge']['url'].$badges['badge_id'].'.gif">';

                }


                self::$staff_containers = self::$staff_containers.'

                        </div>

                      

                    </div>

                ';

            }[/PHP]


Top