try - catch with syntax error : <pre><code>try {
$stmt = $db-&gt;query('SELECT title FROM never-ending-book');
while($row = $stmt-&gt;fetch()){
    echo '&lt;div class="lev3"&gt;'.$row['title'].'&lt;/div&gt;';
    }
}catch(PDOException $e) {
    echo $e-&gt;getMessage();
};
</code></pre>

<p>result:  </p>

<pre><code>SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-ending-book' at line 1
</code></pre>

<p>Where is the syntax error and why is <code>never-ending-book</code> become <code>near'-ending-book</code>?</p>
