抽象データベースレイヤー。PEAR界では、PEAR::DBは非推奨。MDB2を使うようにと言われている。
<php> <?php // Once you have a valid DB object named $db... $table_name = 'user'; $table_fields = array('id', 'name', 'country');
$sth = $db->autoPrepare($table_name, $table_fields,
DB_AUTOQUERY_INSERT);
if (PEAR::isError($sth)) {
die($sth->getMessage());
}
$table_values = array(1, 'Fabien', 'France');
$res =& $db->execute($sth, $table_values);
if (PEAR::isError($res)) {
die($res->getMessage());
} ?> </php>