Home arrow PHP arrow Handling MySQL Data Set Failures in PHP 5

Handling MySQL Data Set Failures in PHP 5

If you’re a PHP developer who wants to learn the basics of implementing customized exceptions in PHP 5, then look no further, because you’ve come to the right place. This is the third part of a four-part series entitled “Subclassing exceptions in PHP 5.” It teaches you how to extend the native exception mechanism bundled with PHP 5 by using inheritance, and complements the corresponding theory with copious, illustrative hands-on examples.

  1. Handling MySQL Data Set Failures in PHP 5
  2. Intercepting MySQL-related exceptions with PHP 5
  3. Triggering custom exceptions when processing MySQL data sets
  4. Handling MySQL and result set exceptions with separated try-catch blocks
By: Alejandro Gervasio
Rating: starstarstarstarstar / 4
October 29, 2008

print this article



Having already introduced you to the main subject of this article series, it's time to summarize the topics that were discussed in the last article, in case you haven't read it yet. In that particular tutorial I explained how to implement a fully-functional customized exception system with PHP 5, which came in handy for handling a number of specific exceptions thrown by a basic MySQL abstraction class.

However, the most relevant part of developing such a exception handling system was the small number of steps it actually took. All I had to do was derive a basic subclass from the pertinent built-in "Exception" class, and provide it with the programming logic required to handle those MySQL-related exceptions. Period.

Of course, although PHP 5 permits us to work with exception subclasses in a relative easy way, this doesn't mean that all of your existing or future applications must incorporate this feature. However, there's a number of situations, particularly when working with large-scale projects, where it's often necessary to utilize customized exceptions.

And speaking of customized exceptions, in the last article I demonstrated how to build a MySQL abstraction class that implemented these in a useful fashion, so in this third tutorial I'm going to show you how to handle all of the errors that might occur when processing MySQL data sets via a specific exception mechanism.

Are you ready to continue learning about the creation of exception subclasses with PHP 5? Let's get going!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: