Blogs

DB_DataObject How To

DB_DataObject is ORM package that enables you to perform CRUD operation very easily and smoothly
we will build a simple contact list
Run the following SQL statement

CREATE TABLE `Contacts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`email` varchar(255) default NULL,
`phone` varchar(15) default NULL,
`address` text,
PRIMARY KEY (`id`)
)

Code the generator
Notes:
1.You need to change the values to match your environment
2.You need to give DataObjects folder 777 permission

CreateDataObjects.php
<?php
require_once('PEAR.php');

Syndicate content