Managing Your Data With DatabaseObject
In this example we looked at the DatabaseObject class by me, Quentin Zervaas.
It is a class that provides a high level interface to your database, making creation, updating and deletion of database records very simple.
Hopefully a few of the examples here have shown how much you can do with the class, and how it can help centralise your code for managing a database table into a single file.
This class is used extensively in the implementation of phpRiot. For instance, there is an ‘articles’ table which holds all the various articles in the site. There is a PHP class called ‘Article’ which is a sub-class of DatabaseObject, used to manage this table.
- Download a PDF version of this article
- Put your PHP knowledge to the test with our online and iPad/iPhone quizzes
- View or post comments for this article
- Browse similar articles by tag: MySQL, PHP, PostgreSQL
- Read related articles: