• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database with no tables returns error

#1
[eluser]Marcone Ramos[/eluser]
Im trying to build an app that starts with an empty database. The database name, host, user and password is correctly set in the config file. The problem is that when the database doen't have any tables, it returns an error. Does anyone know to fix it?

#2
[eluser]Samus[/eluser]
Posting the error might possibly help.

#3
[eluser]Marcone Ramos[/eluser]
thank you for answering.
It's gives me a "HTTP Error 500 (Internal Server Error)".

#4
[eluser]TWP Marketing[/eluser]
Do you mean you nave no tables defined in your database? Then define an empty table.
If you mean you have no records in your table, then your code should test for this and create a record.
Please post your code so we can see what you are doing.

#5
[eluser]Marcone Ramos[/eluser]
I want the app run with no table defined in the database, it will install the tables according to user choices. Right now I have just a simple controller.

Code:
class bm_loader extends CI_Controller{

public function __construct() {
  parent::__construct();
  
}

function index() {
  echo 'debuggin';
}

}

#6
[eluser]InsiteFX[/eluser]
Well I just created an empty database with no tables and did not get any error.

You must have something like mysql installed wrong or your loading the ci database sessions without creating the table for them.

Error 500 is a server error which can be caused by bad code, it is not a mysql error.

#7
[eluser]emily12[/eluser]
I'm not sure why I had a 500 error when I forgot to add auto-indexing to one of my tables once. It only happened once and never again, mainly because sometimes you don't want auto-indexing. Anyways, you could always check the integrity of your table (repair) and see what that does. It's a peculiar problem if it's properly installed and the back-end code on your test website is correct.

#8
[eluser]Marcone Ramos[/eluser]
InsiteFX, you are right. I was loading the ci database sessions without a table for that.
Thank you guys!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.