Welcome Guest, Not a member yet? Register   Sign In
how to access database created with dbforge
#2

(04-22-2019, 10:23 AM)majortom84 Wrote: 1. If a database is created using dbforge, can you use query builder for the dynamic database(insert, update, delete)?  

In a word, yes.

(04-22-2019, 10:23 AM)majortom84 Wrote: 3. How do you "select" the dbforge created database to preform queries on? ("$this->db->query('use db2');" so, this is the 'use' statement and it works the same as in SQL syntax?)

Consult the documentation on Database Configuration. Down that page a way it describes how you can store multiple sets of connection values. If your dbforge database connection is stored like this

PHP Code:
$db['forged'] = array( 
 
       dsn'   => '',
        '
hostname' => 'localhost',
        etc...
); 

That database could be loaded like this.

PHP Code:
$this->load->database('forged'); 

After which you simply use

PHP Code:
$this->db->query_builder_methods_here(); 

The Connecting to Your Database documentation is helpful too.
Reply


Messages In This Thread
RE: how to access database created with dbforge - by dave friend - 04-22-2019, 12:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB