title: PDO Error - Syntax error or access violation: 1064
body: <p>I am trying to run a query but it looks like I am conflicting with a reserved keyword. I can't figure out where the conflict is. I am relatively new to this, so any help would be appreciated.</p>
  
  <p>I have already tried changing all 'row' to 'my_row' - it didn't seem to make a difference.</p>
  
  <p>My code:</p>
  
  <pre><code>        $substmt = $pdo-&gt;prepare('  SELECT 
                                          `sentences_index`.`row_id` AS id,
                                          `sentences_index`.`id` AS char_id,
                                          `sentences_index`.`word`,
                                          `definitions`.`pinyin`,
                                          `definitions`.`def1` AS definition,                             
                                          `sentences`.`sentenceEN`
  
                                      FROM `sentences_index` 
                                      LEFT JOIN `definitions` ON `sentences_index`.`word` = `definitions`.`traditional`
                                      LEFT JOIN `sentences` ON `sentences_index`.`row_id` = `sentences`.`id`
  
                                      WHERE `sentences_index`.`row_id` = :row 
  
                                      GROUP BY `sentences_index`.`word`
                                      ORDER BY char_id ASC
                              ');
          $substmt-&gt;execute(['row' =&gt; $row]);
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Edit: Here is the error message:</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 'AS id, <code>sentences_index</code>.<code>id</code> AS char_id,
    <code>definitions</code>.`p' at line 17 in
    /var/www/html/assets/other/custom_functions.php:520 Stack trace: #0
    /var/www/html/assets/other/custom_functions.php(520):
    PDO->prepare('\tSELECT \n\t\t\t\t\t\t...') #1
    /var/www/html/index.php(216): gc_get_example_sentences(Object(PDO),
    '\xE8\xAF\xB4\xE8\xAF\x9D', 'simplified') #2 {main} thrown in
    /var/www/html/assets/other/custom_functions.php on line 520</p>
  </blockquote>
  
  <p>And I do understand there is a similar question. I have read it and tried to find the same problem in my code. I cannot find the problem, which is why I am asking this question.</p>
  
  <p>Edit2: Interestingly, this error is not thrown in PHP 7.0.0 but is thrown in PHP 7.0.8</p>