So I fixed the issue that I had with the DSN, I set what I believe is the correct hostname:
$db['default']['hostname'] = 'mysql:host=localhost';
$db['default']['username'] = $username;
$db['default']['password'] = $password;
$db['default']['database'] = 'my_database_name';
, but now I’m getting this error
PHP Fatal error: Call to a member function field_data() on a non-object in /system/database/DB_driver.php on line 889
PHP Stack trace:
PHP 1. {main}() /index.php:0
PHP 2. require_once() /index.php:212
PHP 3. call_user_func_array() /system/core/CodeIgniter.php:359
PHP 4. Site->dashboard() /system/core/CodeIgniter.php:359
PHP 5. BlogPost->__construct() /application/controllers/site.php:50
PHP 6. DataMapper->__construct() /application/models/blogpost.php:45
PHP 7. DataMapper->DataMapper() /application/libraries/Datamapper.php:451
PHP 8. CI_DB_driver->field_data() /application/libraries/Datamapper.php:645
Site.php line 50 has the following code
$Blog_Post = new BlogPost();
and blogpost.php (model file) is just the constructor calling the parent
public function __construct($id = null) {
parent::__construct($id);
}
This happens as soon as I try to create any model!
any ideas?
Remember I’m using the PDO driver.
Thank you