I got the following code:

```
<?php

require('connect.php');

if(isset($_GET['region'])) {
    $region = mysql_real_escape_string($_GET['region']);
    if ($region == "eu") {
        $rows = mysql_fetch_array(mysql_query("SELECT  * FROM `daily_leaderboard_eu`"));
    } elseif ($region == "na") {
        $rows = mysql_fetch_array(mysql_query("SELECT  * FROM `daily_leaderboard_na`"));
    }
} else {
    $rows = mysql_fetch_array(mysql_query("SELECT  * FROM `daily_leaderboard_eu`"));
}

?>

<table>
    <tr>
        <td>Rank</td>
        <td>Points</td>
    </tr>
    <tr>
        <?
            if(empty($rows)){
                echo '<td colspan="5">We are unable to provide data at the moment!</td>';
            } else {
                foreach($rows as $row){?>
                    <td><?=$row['rank']?></td>
                    <td><?=$row['points']?></td>
                <?}
            }
        ?>
    </tr>
</table>

```

The code is supposed to fetch the whole `daily_leaderboard_X` table and then present the data in a simple table. It's however not working as I get the following errors:

Warning: Illegal string offset 'rank' in /home/bbb/public\_html/pvp/index.php on line 29
5  

Warning: Illegal string offset 'points' in /home/bbb/public\_html/pvp/index.php on line 30
5

Picture: <http://i.gyazo.com/b1ec034e7d0d906fb81c8175300f288c.png>

Could someone point out my mistake and how to fix it please?