Using What You Know

Pursuing this line of thought, you need to:

  • Filter and order records

  • Know the total number of records

  • Be able to extract sequential subsets of the total

In the context of database classes, the description of the requirements immediately suggests the use of the SQL ORDER BY, WHERE, and LIMIT clauses to order, filter, and extract subsets respectively. You had to create this kind of functionality for the DirectoryItems class, but why recreate what's already available in SQL?

Just as PHP's built-in image manipulation functions helped create the ThumbnailImage class, look also for assistance from the existing MySQL-related functions. If you've used these functions before, you'll immediately know which ones are the most important and the most commonly required. Obviously, you'll need mysql_connect to create a connection to a specific server. Creating a connection is a prerequisite for using mysql_select_db to select a database and mysql_query to execute a query and return a result set of rows.

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

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