. */ interface IDB { /** * Fetch a row from a table * * @param string $table * @param int $id * @return array associative array */ function fetchRow($table, $id); /** * Select data * * @param string $query * @return IResult */ function select($query); /** * Insert data into a table * * @param string $table * @param array $data * @return int insertId, -1 in case of error */ function insert($table, $data); /** * Update a record * * @param string $table * @param int $id * @param array $data * @param string $idField * @return boolean true on success, false otherwise */ function update($table, $id, $data, $idField = "id"); /** * Delete data * @param string $table * @param int or array of int $ids * @param string $idField */ function delete($table, $ids, $idField = "id"); /** * Flush privileges */ function flushPrivileges(); /** * Escape field for usage in select query. In case field contains a dot (.), it will be split and both sides will be escaped. May be an array * of several fields * * @param string $field * @return string escaped field */ function escapeField($field); /** * Escape value for usage in select query * * @param string $value * @return string escaped value */ function escapeValue($value); /** * Return the error generated by last query * * @return string error */ function getLastError(); /** * Return the version number of the server * * @return string server version */ function getServerVersion(); } ?>