title: How do I raise PDOException?
body: <p>This code works fine, but I'll want to handle <code>exception</code> if any thing goes wrong, so I deliberately made a syntax error in the <code>query</code> but nothing happens. Below is the code</p>
  
  <pre><code>try {
      $sql = "INSERT INTO journals (topic, author, ) VALUES ('$topic', '$authors', ')";
      echo "1st";
      $lecturers_db-&gt;query($sql);
      echo "second";
  } catch(PDOException $e) {
      echo $e-&gt;getMessage();
      echo $msg = "Error!";
  } 
  </code></pre>
  
  <p>Without the obvious syntax error, the code works fine but with the syntax error, nothing happens, all the code in the <code>try block</code> executes and the code in the <code>catch block</code> never executes. </p>
  
  <p>I want to raise an <code>exception</code>, please how do I do it here, thanks for any help. </p>