Where to Go from Here

In this chapter we've improved on our original database classes by creating our own exception class. This, in turn, allowed us to take a completely OO approach to handling exceptions rather than simply trapping errors and terminating the application. We added the ability to use a MySQLResultSet in a foreach loop by implementing the Iterator interface, and we explored the concept of inheritance both for classes and for interfaces.

We've spent a lot of time creating database classes because they are useful tools for making websites dynamic. In the next chapter, we're going to take a detailed look at some of the concepts introduced here. After that we'll take a look at other ways to add content to a website dynamically.

Get Object-Oriented PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.