MySQL Database Abstraction 2.0
This PHP class provides an abstraction layer for MySQL. The main purpose is to encapsulate and simplify the details of connecting to a MySQL database and performing queries.
MySQL Database Abstraction is for MySQL only is designed for a single database; to use it, extend the class in your code, with the given database/user/password you will connect to.
Usage:
// Include the class definition file.
require_once('class.db.inc');
// Extend the class with your own database parameters
class DB_Mysql extends DB {
var $host = 'host.db.com';
var $database = 'dbname';
var $user = 'username';
var $password = 'password';
}
// Instantiate the class
$db =& new DB_Mysql;
// Run a SQL query
$db->query('SELECT * FROM table');
// Iterate through the result set (if any)
while ( $db->next_record() ) {
// Retrieve the value for a particular field in the current row
$field = $db->f('field');
// etc...
}
?>
More popular Database Tool
- PHP DataGrid 4.2.8 (1 year, 6 months 4 days ago)
- ajaxCRUD 5.0 (2 years, 4 months 25 days ago)
- phpMyDataGrid 2007 - AJAX Enabled Datagrid 1.0 (2 years, 4 months 25 days ago)
- XAJAX Grid 1.0 (2 years, 4 months 25 days ago)
- PHP MySQL Connection Class 1.0 (2 years, 8 months 29 days ago)
Listing Files

class.db.inc- 13.2 KB
- 04/10/2008 11:58:00
- FREE MySQL Cloud Database Super Simple, Zero-Management MySQL Cloud DB. Use It FREE!
- Pinterest clone Start your own pin board social network today. Get Pintastic and start your own pinterest clone network.
- MYRE Real Estate Software Professional Real Estate solutions by MYREPHP PROGRAMMING!
