title: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 5
body: <p>Whats wrong with my code? The specific error message is:</p>
  
  <blockquote>
    <p>Error querying database You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 5</p>
  </blockquote>
  
  <p>My code is:</p>
  
  <pre><code>if (isset($_POST['submit'])) {
      $name = $_POST['name'];
  
  $query = mysql_query("
      SELECT timein, timeout 
      FROM studentInfo
      WHERE name = '$name' 
      ORDER BY time DESC
      LIMIT *
      ")
      or die("Error querying database ".mysql_error());
  while($minutes = mysql_fetch_array($query)){
    echo "timein: ".$minutes['timein']."&lt;br /&gt;";
    echo "timeout: ".$minutes['timeout']."&lt;br /&gt;";
    }
    }
  </code></pre>