title: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation
body: <p>I don't know why am I gettng the error </p>
  
  <blockquote>
    <p>Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or
    access violation: 1064 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 'Preprocessor' at line 1 in
    /var/www/html/phpquiz/result.php:17</p>
  </blockquote>
  
  <p>There error occurs when executing the prepared statement i.e. on executing 
  <code>$cho-&gt;execute();</code></p>
  
  <pre><code>&lt;?php
  session_start();
  if(!isset($_SESSION['score'])){
      $_SESSION['score'] = 0;
  }
  
  if(isset($_POST['submit'])){
      $arr = array("a", "b", "c", "d", "e");
      for($i = 1; $i &lt; 6; $i++){
          $text = $_POST['que_'.$arr[$i-1]];
          echo "$text&lt;br&gt; ";
          $cho = $pdo-&gt;prepare("SELECT id from choices where `text` = $text");
          $cho-&gt;execute();
          $r = $cho-&gt;fetch(PDO::FETCH_ASSOC);
          echo $r;
      }
  }
  </code></pre>