User Tools

Site Tools



ImpactClub PHP Database

database.jpg DATABASE is a package designed to work in PHP 4.x or 5.x. It can be used freely by anyone in personal or business application, in non commercial way. It represents a general way to database abstraction and standardization.


How to use

Database configuration


Database connection

global $database;
$database = new CDatabase();


$query  = 'SELECT * FROM table WHERE col=condition';
$value  = $database->getValue($query);  // single value
$array  = $database->getRow($query);    // array of values
$matrix = $database->getArrays($query); // array of arrays of values
$insert = $database->setInsert($query); // autoincremet id of a INSERT query
$update = $database->setUpdate($query); // update rows number of a UPDATE query
$delete = $database->setDelete($query); // update rows number of a DELETE query
php/database.txt · Last modified: 2008/04/29 12:43 (external edit)