Trying to make a setup for my application. However, I am having trouble getting it to create the database for me.
If I create the database manually, everything is fine.
If the database is not there, I can't do anything, and I get the following error:
A Database Error Occurred Unable to select the specified database: my_db
Filename: core/Loader.php
Line Number: 232
I'm following the dbutil guide.
My code:
function index()
{
$db_exists = FALSE;
$this->load->dbutil();
if( $this->dbutil->database_exists( 'my_db' ) ){
$db_exists = TRUE;
}
}
As per the guide, I get my database driver running in application/config/autoload.php
$autoload['libraries'] = array( 'database', 'datamapper' );