require_once('php-db-table/DBTable.php'); $dbTable = new DBTable('my_table', 'my_database'); $allRecords = $dbTable->getAllRecords(); foreach($allRecords as $record){ echo $record['id'] . ' ' . $record['name'] . ' ' . $record['age'] . "\n"; }
require_once('php-db-table/DBTable.php'); $dbTable = new DBTable('my_table', 'my_database'); $newRecord = array( 'name' => 'John Smith', 'age' => 30 ); $dbTable->insertRecord($newRecord);In this example, the DBTable library is used to insert a new record into a table called 'my_table' in the 'my_database' database. The record contains a name and age field. The package library for PHP DB table is likely to be PEAR, a popular repository for PHP packages.