diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index 2a6c901337..fdc1657c5a 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -495,9 +495,9 @@ if (!$cat_values['parent'] || $cat_values['parent'] == 0) { - $this->db->query("SELECT MAX(cat_id) AS max FROM phpgw_categories",__LINE__,__FILE__); + $this->db->query("SELECT MAX(cat_id) FROM phpgw_categories",__LINE__,__FILE__); $this->db->next_record(); - $max = $this->db->f('max'); + $max = $this->db->f(0); $this->db->query("UPDATE phpgw_categories SET cat_main='" . $max . "' WHERE cat_id='" . $max . "'",__LINE__,__FILE__); }