I need some help trying to fetch and echo all data from a column in a mysql table. Take a look at the code I posted below. In the mysql table "tickets" I have two rows with column name "ticket_result" One of the rows for "ticket_result" has "winner" and the other says "loser".


PHP Code:
public function tickets() {
       
$this->db_connection = new mysqli('''''''');


                 
$sql "SELECT tickets.ticket_result AS ticket_result
                         FROM users, tickets
                         WHERE tickets.member_id = users.user_id AND users.user_id = '1'"
;
                 
$query $this->db_connection->query($sql);
               
               while (
$row $query->fetch_object()) {
               global 
$me2;
               
$me2 $row->ticket_result;
               
              
             }
     } 
HTML Code:
<?php $classLogin->tickets(); ?>
          
<table>

<thead>
<th>Result</th>
</thead>

<tr>
<td><?php echo $me2; ?> </td>
</tr>

</table>
The code echoes works but it only echoes "loser" into the table and not winner also. I tried adding a foreach loop before <table> but it doesn't work because I guess "$me2" isn't an array. I also tried changing the php code from "fetch_object" to "fetch_assoc" and "fetch_array" but that doesn't work either.

The only way I was able to get both "winner" and "loser" to be echoed to the page was when I changed the php code to this.

PHP Code:
   $query $this->db_connection->query($sql);
               
               while (
$row $query->fetch_object()) {
               echo 
$row->ticket_result;
               
              
             } 
Is there a better way I can do this so that I can add a foreach loop to the table and echo all data from the column?