{{keywords>php class database mysql query value row array insert update delete}} ====== ImpactClub PHP Database ====== {{php: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. ===== Download ===== * 1.0 stable (23/02/2005) -- {{php:database.1.0.zip|}} * 1.1 RC -- available soon ===== How to use ===== **Database configuration** $config['database']['host']='localhost'; $config['database']['username']='username'; $config['database']['password']='password'; $config['database']['dbname']='database_name'; **Database connection** global $database; $database = new CDatabase(); **Query** $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