Welcome Guest, Not a member yet? Register   Sign In
Database with no tables returns error

[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?

Posting the error might possibly help.

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

[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.

[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.

class bm_loader extends CI_Controller{

public function __construct() {

function index() {
  echo 'debuggin';


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.

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.

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

Theme © iAndrew 2016 - Forum software by © MyBB