Jump to content

PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION


terryds
 Share

Recommended Posts

Can you tell me what the function of PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ?I've read the php manual, but i still dont understand that...If i remove the setattributte method, it looks alright too... What's the function of that actually ?

Link to comment
Share on other sites

It is the one of the 3 error mode in PDO. if error mode is set to ERRMODE_EXCEPTION it will throw exception when an error occurs in database. There is more two mode-silent,warning. warning will show error as PHP warning without halting the script. Where as silent will do nothing, you need to use errorInfo() or errorCode() to see the errors. using exception is better option among the others.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...