phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-developers] Couple of table setup questions


From: Brian Johnson
Subject: [Phpgroupware-developers] Couple of table setup questions
Date: Mon, 18 Aug 2003 13:10:32 +0000

I need to add some default records to the setup of addressbook and am trying to
determine the functions of default_records.inc.php, setup.inc.php,
tables_baseline.inc.php, tables_current.inc.php, and tables_update.inc.php

Could someone give me a summary of thier function?

Does the default_records.inc.php get run only when it is a new install or does 
it
also run when it is an update?

Without analysing the SQL (it works when run in a postgresql client), could 
someone
suggest why with this code never goes into the while loop?

                $db2 = $GLOBALS['phpgw_setup']->db;
                // migrate existing data to phpgw_contact_person
                $GLOBALS['phpgw_setup']->db->query("SELECT id, owner, access,
cat_id, '1' AS contact_type_id FROM phpgw_addressbook ORDER BY id");
                print_r("test1\n");
                while ($GLOBALS['phpgw_setup']->oProc->next_record())
                {
                        $db2->query("INSERT INTO phpgw_contact
(owner,access,cat_id,contact_type_id,ab_id) VALUES ("
                                . $GLOBALS['phpgw_setup']->oProc->f('owner')
                                . "," .
($GLOBALS['phpgw_setup']->oProc->f('access')?"'".$GLOBALS['phpgw_setup']->oProc->f('access')."'":"null")
                                . "," .
($GLOBALS['phpgw_setup']->oProc->f('cat_id')?"'".$GLOBALS['phpgw_setup']->oProc->f('cat_id')."'":"null")
                                . "," .
$GLOBALS['phpgw_setup']->oProc->f('contact_type_id')
                                . "," . $GLOBALS['phpgw_setup']->oProc->f('id')
                                . ')');
                        print_r("test2\n");
                }
                print_r("test3\n");





reply via email to

[Prev in Thread] Current Thread [Next in Thread]