title: Parse error: syntax error, unexpected $end
body: <p>I keep getting an error message when creating an output from my database.</p>
  
  <p>ERROR MESSAGE: "Parse error: syntax error, unexpected $end in XXXXXXXXX.php on line 26."</p>
  
  <p>Code being used it below.     </p>
  
  <pre><code>&lt;?php
      require('connectDB.php');
  
      if ($connection) {
        echo "Connected to database!";
      } else {
            die("Connection failed: " . mysqli_connect_error());
  
      $query = "SELECT title, description, body, created FROM diary_post";
      $result = mysql_query($query);
  
      $retval = mysql_query( $query, $connection );
      if(! $retval )
      {
        die('Could not get data: ' . mysql_error());
      }
      while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
      {
          echo "title :{$row['title']}  &lt;br&gt; ".
               "description : {$row['description']} &lt;br&gt; ".
               "body : {$row['body']} &lt;br&gt; ".
               "created : {$row['created']} &lt;br&gt; ".
               "--------------------------------&lt;br&gt;";
      } 
      echo "Fetched data successfully\n";
      mysql_close($conn);
      ?&gt; 
  </code></pre>
  
  <p>Does anyone have any suggestions to why this isn't working? Thank you.</p>