正确列出网站文章

So I've been using PHP to list my website's articles via MySQL. The problem is, the posts are supposed to be listed with newest at the top, but instead oldest posts are at the top. How can I change this. Here is a snippet of source code:

<?php foreach ($posts as $post): ?>
   <div class="container">
      <h2 class="title"><a href=""><?php echo htmlspecialchars($post['title'], ENT_QUOTES, 'UTF-8'); ?></a></h2>
      <p class="date"><?php echo htmlspecialchars($post['date'], ENT_QUOTES, 'UTF-8'); ?></p>
      <div class="body">
      <p><?php echo htmlspecialchars($post['content'], ENT_QUOTES, 'UTF-8'); ?></p>
      </div>
   </div>
   <?php endforeach; ?>

try {

   $sql = 'SELECT id, title, date, content FROM post';
   $result = $pdo->query($sql);

} catch (PDOException $e) {

   $error = 'Error connecting to database server: ' . $e->getMessage();
   exit();

}

In your initial query, be sure to include the line

ORDER BY $column 

and then either

ASC

or

DESC

Where $column references the date column, I would presume.