Page 1 of 1

Retrieving MySQL exceptions

Posted: Tue Dec 02, 2008 12:46 pm
by stagtechnologies
Hi

I want to display the actual exceptions that occurs on the database side rather than showing my custom messages in PHP using throw clause. How can i do this?
eg: on inserting a record in the database, i am getting a unique constraint violation exception but i dont know how to display it in php.

Thanks and regards
Admin
http://www.stagtechnologies.com

Re: Retrieving MySQL exceptions

Posted: Wed Dec 03, 2008 3:01 am
by jaoudestudios
Do a check first to see if the entry already exists, if so then you have your flag, if not you can do the insert :)

Re: Retrieving MySQL exceptions

Posted: Wed Dec 03, 2008 10:02 am
by stagtechnologies
thanks
but i dont want to do that on the application side
i have got integrity constraints in place in the database
they are giving me exceptions
i just want to print those on the UI using php
can i do that