Case Study: Handling MySQL Growth With a PHP Class
(Page 1 of 5 )
Sick of updating your MySQL database to add new fields half way through a project? In this article Bjorn discusses his PHP class that you can use to make changes to your MySQL database on the fly!For those of you who are just starting out with PHP and MySQL (as I once was), it's common to just jump right in and start building your MySQL tables with
PHPMyAdmin and not make any considerations for future database growth or needs... isn't it? We've all done it, and we all know we shouldn't, but it's quick and easy.
I've been working on a document-publishing engine that can extend a MySQL database in the form of a PHP class. Basically, if you want to add a field to your MySQL database, the PHP class acts as a wrapper to your database and adds the field for you. Sound complex? Well, it isn't, and in this article I will show you the code that I've used to make this class -– a kind of case study if you will.
You will need PHP 4.1 and MySQL 3.23 or above. I will assume that you're running a Linux web server, but everything will also work on a Windows 2000 server with Apache/IIS.
Next: Generic MySQL Tables >>
More MySQL Articles
More By Bjorn Roysland