From 076235bd39232c88c29d57b4e97059f3b7781210 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 18 Aug 2009 12:17:18 -0400 Subject: [PATCH] Fix column name, check for error from DB --- kronolith/lib/Driver/Sql.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.11.0