One Lump or Two?

There are two distinct classes that can be built around these existing PHP MySQL functions, depending upon your preferences: a connection class and a result set class. First, you'll create a database connection class, as you might imagine, making use of the mysql_connect function. A connection is server-specific and can be used to create any number of result sets taken from any database on that server. It simply sets up communication between a web page and a database server. A result set makes use of a connection in order to update or display data. You'll build a MySQL result set class around the mysql_select_db and mysql_query functions.

You will develop fairly skeletal versions of these two classes, emphasizing any unexplored ...

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.