title: PHP SQL Query Limit 1
body: <p>I need help with my SQL Query</p>
  
  <pre><code>&lt;?php
  include 'connect.php';
  $pdo = Database::connect();
  
  $sql = "SELECT Visit_Date FROM tbl_patient_med_record WHERE PatientID=".$_GET['PatientID'] order by Visit_Date limit 1;
  
  foreach ($pdo-&gt;query($sql) as $row){    
  
      echo  date('F j,Y',strtotime($row['Visit_Date']));
  }                       
  Database::disconnect();
  ?&gt;
  </code></pre>
  
  <p>The goal is to output the most recent value of Visit_Date. But it seems my code is not working. Any possible remedies for this? Thanks</p>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected 'order' (T_STRING) in
    C:\xampp\htdocs\capstone_ncd\patient_Profile.php on line 337</p>
  </blockquote>