From 0b53b03eaef3e50ae98905c7a65d003d956a448d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Mar 2003 23:14:21 +0000 Subject: [PATCH] skwashd's patch to use last_insert_id instead of an extra max(id) query --- phpgwapi/inc/class.contacts_sql.inc.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.contacts_sql.inc.php b/phpgwapi/inc/class.contacts_sql.inc.php index 56c3417cc7..aa171e39e8 100644 --- a/phpgwapi/inc/class.contacts_sql.inc.php +++ b/phpgwapi/inc/class.contacts_sql.inc.php @@ -595,9 +595,7 @@ . ") VALUES ('$owner','$access','$cat_id','$tid','".$lid[1] . implode("','",$this->loop_addslashes($stock_fields)) . "')",__LINE__,__FILE__); - $this->db->query("SELECT max(id) FROM $this->std_table ",__LINE__,__FILE__); - $this->db->next_record(); - $id = $this->db->f(0); + $id = $id = $this->db->get_last_insert_id($this->std_table, 'id'); if(count($extra_fields)) {