From: Michael J. Rubinsky Date: Tue, 18 Aug 2009 16:17:18 +0000 (-0400) Subject: Fix column name, check for error from DB X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=076235bd39232c88c29d57b4e97059f3b7781210;p=horde.git Fix column name, check for error from DB --- diff --git a/kronolith/lib/Driver/Sql.php b/kronolith/lib/Driver/Sql.php index 000d141c4..8e77e7eb8 100644 --- a/kronolith/lib/Driver/Sql.php +++ b/kronolith/lib/Driver/Sql.php @@ -798,9 +798,12 @@ class Kronolith_Driver_Sql extends Kronolith_Driver public function getResource($id) { - $query = 'SELECT resource_id, resource_name, resource_calendar, resource_category FROM kronolith_resources WHERE resource_uid = ?'; + $query = 'SELECT resource_id, resource_name, resource_calendar, resource_category FROM kronolith_resources WHERE resource_id = ?'; $results = $this->_db->getRow($query, array($id), DB_FETCHMODE_ASSOC); + if ($results instanceof PEAR_Error) { + throw new Horde_Exception($results->getMessage()); + } $return = array(); foreach ($results as $field => $value) { $return[str_replace('resource_', '', $field)] = $this->convertFromDriver($value);