Welcome Guest, Not a member yet? Register   Sign In
database config file
#8

[eluser]cinewbie81[/eluser]
[quote author="sergitin" date="1192697313"]I give you the option of to change the value of
Code:
$db['default']['database']

the other option is to begin with one connection setting and then you have created the other database
then you can work with another connection variable and not to touch the original one...
OK??[/quote]

Thanks. It's working now .. The code as following:
Code:
<?php

class Setup extends Controller {

    function Setup()
    {    
        parent::Controller();
            $this->load->helper(array('url', 'form'));
    }


    function RunSetup()
    {
           //"default" is a group that point to mysql database
           $DB1 = $this->load->database('default', TRUE);
           $DB1->query('CREATE DATABASE NEWDB');

           $DB2 = $this->load->database('myDB', TRUE);
    }
}



Anyway, I've got another question.. I have

Instead of have to load the database group everytime, how can I use this $DB1 and $DB2 value in other class of my project ?? Hope someone can help. Thanks !


Messages In This Thread
database config file - by El Forum - 10-15-2007, 06:37 AM
database config file - by El Forum - 10-15-2007, 08:48 AM
database config file - by El Forum - 10-15-2007, 09:35 AM
database config file - by El Forum - 10-15-2007, 06:38 PM
database config file - by El Forum - 10-17-2007, 08:07 PM
database config file - by El Forum - 10-17-2007, 08:32 PM
database config file - by El Forum - 10-17-2007, 09:48 PM
database config file - by El Forum - 10-19-2007, 05:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB