[eluser]Jay Turley[/eluser]
Hi, all.
I'm new to codeIgniter, coming from the world of .NET and classic ASP. And I am much happier now
I'm trying to use DBforge to (1) drop a database, (2) create a database, and (3) create some tables.
I have no problems with (1) and (2). However, after I have created the database, and I try to add a table, I get the following error message:
Quote:An Error Was Encountered
Error Number: 1102
Incorrect database name ''
SHOW TABLES FROM ``
I assumed this was due to the fact that initially, my database configuration (config/database.php) was
Code:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "blah";
$db['default']['database'] = "";
$db['default']['dbdriver'] = "mysql";
So I added a line to the table creation bit to set the default database, since it isn't loaded.
Code:
$this->database_model->create_database();
$db['default']['database'] = "mydb";
Basically, what I am trying to do is allow a first-time user to set up a database if it doesn't exist, and then to create the tables. Since the database doesn't exist, I can't set the default database in database.php.
I have a feeling this problem is due to my inexperience with the framework; perhaps I am approaching the problem in the wrong way?
Any help would be greatly appreciated.