This code works fine, but I\'ll want to handle exception if any thing goes wrong, so I deliberately made a syntax error in the query but nothing ha
Exceptions are thrown. Syntax errors in code != Exceptions.
However, from the maual:
You should not throw a PDOException from your own code. See Exceptions for more information about Exceptions in PHP.
My advice is to throw either a general exception, or to write your own custom exception to handle your error.