Using PHP Objects to Access Your Database Tables (Part 2)
By Tony Marston2005-04-07
Intended Audience
This is a follow-up to Using PHP Objects to access your Database Tables (Part 1) in which I showed you how to create a base class to contain all the standard code to access any database table, how to create extensions to this class for each individual table, and how to access these classes from within your PHP scripts. In this tutorial I will show you how to enhance the basic class to incorporate the following:
• How to cater for the many options on a MySQL SELECT statement.
• How to add the features of a Data Dictionary or Repository.
• How to use the Repository for standard validation.
• How to use the Repository to validate changes to candidate keys.
• How to use the Repository to handle related tables when deleting rows.
• How to add code for custom processing.
Prerequisites
It is assumed that you have read and understood Part 1 of this article and wish to know more.
Tutorial Pages:
» Intended Audience
» Extending the MySQL SELECT statement
» Adding the features of a Data Dictionary/Repository
» Using the Data Dictionary/Repository
» Changing Candidate Keys
» Deleting Rows
» Custom Processing
» Virtual Database Tables
» Summary
