Skip to content
Advertisement

Tag: exception-handling

Is it OK to swallow an exception for DB INSERT

Is it OK to swallow Duplicate key violation exceptions for INSERTS or should you check if the record exists? So let’s say that I have a table Photo with one field: PhotoName. I’m looking through a file directory to add items to Photo. In the process, it’s possible that when I find a photoname, it might already be in the

PDO Exception Questions – How to Catch Them

I’m using PDO to re-write a website interface for a database. I used to use the mysql extension, but I had never bothered with error handling, and the few error handlers I had were basically copy-paste. Now I’d like to do this right. However, I’m having issues catching the errors how I’d like (errors like “Duplicate Entry”, “Null Value” etc

Advertisement