driver =& $driver; } function connect($host, $user, $password, $database) { return $this->driver->connect($host, $user, $password, $database); } function disconnect() { return $this->driver->disconnect(); } function isConnected() { return $this->driver->isConnected(); } /** * @return single row, or single value, or FALSE on error */ function selectOne($sql, $args='', $FILE='', $LINE='') { return $this->driver->selectOne($sql, $args, $FILE, $LINE); } /** * @return array of assoc arrays, or NULL if no matches found, or FALSE on error */ function selectRows($sql, $args='', $FILE='', $LINE='') { return $this->driver->selectRows($sql, $args, $FILE, $LINE); } /** * Returns ordered array of first column of each selected record in result set, so $sql need not be a query * that returns a single column (but probably should be) * @return array ordered array */ function selectColumn($sql, $args='', $FILE='', $LINE='') { return $this->driver->selectColumn($sql, $args, $FILE, $LINE); } /** * @return number of rows affected */ function execute($sql, $args='', $FILE='', $LINE='') { return $this->driver->execute($sql, $args, $FILE, $LINE); } /** * Prepare a statement for execution w/ executePrepared(), this is client-side prepared statement */ function prepare($sql) { $this->driver->prepare($sql); } /** * Execute a prepared statement. * @param mixed $args scalar or ordered array */ function executePrepared($args) { $this->driver->executePrepared($args); } /** * @return int number of rows affected by last query */ function affectedRows() { return $this->driver->affectedRows(); } /** * @return information on last error or FALSE if there was none * @todo accumulate errors? */ function lastError() { return $this->driver->lastError(); } /** * The driver will attempt to return the last insert ID or FALSE if feature is not supported */ function lastInsertID() { return $this->driver->lastInsertID(); } /** * Private (package private) method to strip slashes */ function array_stripslashes(&$var) { if(is_array($var)) { return array_map(array('DBWrapper', 'array_stripslashes'), $var); } else { return stripslashes($var); } } /** * Returns FALSE if unable to start transaction */ function startTransaction() { $res = $this->driver->startTransaction(); if($res === FALSE) { trigger_error("DBWrapper::startTransaction - transactions not supported"); } return $res; } /** * Returns FALSE if unable to commit */ function commit() { $this->driver->commit(); } /** * Returns FALSE if unable to rollback! */ function rollback() { $this->driver->rollback(); } function escape($arg) { return $this->driver->escape($arg); } } ?>