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 areas of object-oriented programming (OOP). Nevertheless, these classes will be perfectly fit for the task of testing the versatility of the PageNavigator class.

In this chapter, we'll take a slightly different approach to the code. I'll show the data members and the methods of the class, but I'll only reproduce code that requires comment. As usual, the complete code is available at the companion website, so don't hesitate to download it and refer to it if you find this helpful.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.196.182