[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.84,1.85
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.84,1.85 |
Date: |
Mon, 02 Sep 2002 18:03:02 -0400 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv903
Modified Files:
class.categories.inc.php
Log Message:
update add function to return the id
Index: class.categories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.categories.inc.php,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** class.categories.inc.php 3 Jul 2002 00:55:47 -0000 1.84
--- class.categories.inc.php 2 Sep 2002 22:03:00 -0000 1.85
***************
*** 496,507 ****
. "','" . $cat_values['main'] . "','" .
$cat_values['level'] . "')",__LINE__,__FILE__);
if (!$cat_values['parent'] || $cat_values['parent'] ==
0)
{
- $this->db->query("SELECT MAX(cat_id) FROM
phpgw_categories",__LINE__,__FILE__);
- $this->db->next_record();
- $max = $this->db->f(0);
$this->db->query("UPDATE phpgw_categories SET
cat_main='" . $max . "' WHERE cat_id='"
! . $max . "'",__LINE__,__FILE__);
}
}
--- 496,507 ----
. "','" . $cat_values['main'] . "','" .
$cat_values['level'] . "')",__LINE__,__FILE__);
+ $max =
$this->db->get_last_insert_id('phpgw_categories','cat_id');
+
if (!$cat_values['parent'] || $cat_values['parent'] ==
0)
{
$this->db->query("UPDATE phpgw_categories SET
cat_main='" . $max . "' WHERE cat_id='"
! . $max .
"'",__LINE__,__FILE__);
}
+ return $max;
}
***************
*** 519,523 ****
$this->db->query("DELETE FROM phpgw_categories WHERE
cat_id='$cat_id' $subdelete AND cat_appname='"
! . $this->app_name . "'",__LINE__,__FILE__);
}
--- 519,523 ----
$this->db->query("DELETE FROM phpgw_categories WHERE
cat_id='$cat_id' $subdelete AND cat_appname='"
! . $this->app_name .
"'",__LINE__,__FILE__);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.categories.inc.php,1.84,1.85,
Bettina Gille <address@hidden> <=