Getting closer

This commit is contained in:
Miles Lott 2001-02-13 01:15:43 +00:00
parent 38ae5e2213
commit ff072b55d5

View File

@ -92,7 +92,7 @@
$phpgw_setup->db->query($sql); $phpgw_setup->db->query($sql);
// create an extra db object for the two nested queries below // create an extra db object for the two nested queries below
$db1 = $db2 = $db3 = $phpgw_setup->db; $db1 = $db2 = $db3 = $db4 = $phpgw_setup->db;
// read in old addressbook // read in old addressbook
$db1->query("select * from addressbook"); $db1->query("select * from addressbook");
@ -135,16 +135,16 @@
. $fields["adr_locality"]."','".$fields["adr_region"]."','".$fields["adr_postalcode"]."'," . $fields["adr_locality"]."','".$fields["adr_region"]."','".$fields["adr_postalcode"]."',"
. $fields["owner"].")"; . $fields["owner"].")";
$db1->query($sql); $db2->query($sql);
// fetch the id just inserted // fetch the id just inserted
$db2->query("SELECT max(id) FROM phpgw_addressbook ",__LINE__,__FILE__); $db3->query("SELECT max(id) FROM phpgw_addressbook ",__LINE__,__FILE__);
$db2->next_record(); $db3->next_record();
$id = $db2->f(0); $id = $db3->f(0);
// insert extra data for this record into extra fields table // insert extra data for this record into extra fields table
while (list($name,$value) = each($extra)) { while (list($name,$value) = each($extra)) {
$db3->query("INSERT INTO phpgw_addressbook_extra VALUES ('$id','" . $$fields["owner"] . "','" $db4->query("INSERT INTO phpgw_addressbook_extra VALUES ('$id','" . $$fields["owner"] . "','"
. addslashes($name) . "','" . addslashes($value) . "')",__LINE__,__FILE__); . addslashes($name) . "','" . addslashes($value) . "')",__LINE__,__FILE__);
} }
} }