If you run the next bit of code from a Kohana 3.1 controller
$query = DB::select("select * from foo");
$results = $query->execute();
foreach($results as $result)
{
var_dump($result);
}
Kohana will try to connect to the database using information from the array returned application/config/database.php. In particular, if you will use the information specified in the default group .
return array
(
'default' => array
(
'type' => 'mysql',
'connection' => array(
'hostname' => 'localhost',
'database' => 'kohana',
'username' => FALSE,
'password' => FALSE,
'persistent' => FALSE,
However, this configuration array accepts a few top-level elements (I think this is called db groups). How should I / should tell Kohona 3.1 to connect and query using the information set in a non-default db group.
source
share