[21025] Improvement: fetchmode assoc 4686:4746

Sigurd Nes <[email protected]> Sun, 07 Feb 2010 10:45:09 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 21025
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=21025
Author:   sigurdne
Date:     2010-02-07 10:45:08 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
Improvement: fetchmode assoc 4686:4746

Modified Paths:
--------------
    people/sigurdne/modules/todo/trunk/inc/class.sotodo.inc.php

Modified: people/sigurdne/modules/todo/trunk/inc/class.sotodo.inc.php
===================================================================
--- people/sigurdne/modules/todo/trunk/inc/class.sotodo.inc.php	2010-02-07 10:44:53 UTC (rev 21024)
+++ people/sigurdne/modules/todo/trunk/inc/class.sotodo.inc.php	2010-02-07 10:45:08 UTC (rev 21025)
@@ -417,16 +417,16 @@
 			$this->db->query("select $item from phpgw_todo where todo_id=" . intval($todo_id),__LINE__,__FILE__);
 			if($this->db->next_record())
 			{
-				return $this->db->f(0);
+				return $this->db->f($item);
 			}
 		}
 
 		function exists($todo_id)
 		{
-			$this->db->query('select count(*) from phpgw_todo where todo_id_parent=' . intval($todo_id),__LINE__,__FILE__);
+			$this->db->query('select count(*) as cnt from phpgw_todo where todo_id_parent=' . intval($todo_id),__LINE__,__FILE__);
 			$this->db->next_record();
 
-			if($this->db->f(0))
+			if($this->db->f('cnt'))
 			{
 				return True;
 			}