The code will most likely work, assuming you're using the PDO MySQL driver and you've set PDO::ERRMODE_EXCEPTION on $dbh. However, PDOStatement::execute officially returns False "on failure", while exceptions are thrown "on error". The difference isn't well defined, but there might be instances...