以相反的方式获取我桌子上的列表[重复]

This question already has an answer here:

How can I fetch the list on my table in reverse order?

Like for example:

The records are

1 2 3 4 5

I want it in reverse

5 4 3 2 1

$query = "SELECT * FROM chat ORDER BY id DESC LIMIT 10";
$run = $con->query($query);
while($row = $run->fetch_array()):
    ?>
        <div id="chat_data">
            <table id="chattbl">
                <tr>
                    <td>
                        <h3><?php echo $row['name']; ?>:</h3>
                    </td>
                    <td>
                        <p><?php echo $row['msg']; ?></p>
                    </td>
                </tr>
            </table>
            <h5><?php echo formatDate($row['date']); ?></h5>
        </div>
</div>

Just use ASC instead of DESC for switching the order of your records:

$query = "SELECT * FROM chat ORDER BY id ASC LIMIT 10";