in my controllers folder I have a file Migrate.php with the following method :
function drop_db($db_name){
if ($this->dbforge->drop_database($db_name))
{
echo "Database {$db_name} deleted!";
}
}
When called I need it to drop the database, however I get the following error:
An uncaught Exception was encountered
Type: ErrorException
Message: pg_query(): Query failed: ERROR: cannot drop the currently open database
I tried to close the connexion using $this->db->close(); at the beginning of my method but I still get the same error!
postgresdatabase that should be created by default in your Postgres cluster.$this->dbforge->drop_database($db_name)?