Codeigniter Session Database Error Number: 1064

I was coding a session which I am going to use for storing the user cookies when I encountered this codeigniter session database error number: 1064. I made a mistake at first which I included the fix as I think it might help others as well who are just new in using codeigniter.

1. I initialize first the session library on one of my controllers. You encounter the codeigniter session database error number: 1064 when you failed to create a database table first before initializing the session library to store the session data since the session library will always store a data when your app or website loads. So again, create first a database table then initialize the session library.

2. You need to add a save path for session data. In my case I used the database as my session driver. In which at first I fail to create it. Open application/config/config.php and add the name of your database table in which you are going to store the session data.

Enjoy!

Fix Codeigniter Database Error 1075

Here are several ways to fix codeigniter database error 1075 – Incorrect table definition; there can be only one auto column and it must be defined as a key. The sequence of the fixes are based on what I had did first before I was able to fix the codeigniter database error 1075.

1. I add the add_key function of dbforge.

2. I run the add_key function on top of the create_table() function of dbforge.

3. Since I am using an array container for the fields, I add a PRIMARY KEY statement on my id column.

If none of the above fix didn’t work, just let me know. =)

Enjoy!

Fix No Migration Could Be Found With The Version Number: 1

Another problem I encountered using migration in codeigniter 3 is No migration could be found with the version number: 1. Clearly it is pointing to my migration file but I already created a migrations directory as well as adding a migration class file to be use. Fortunately I was able to found the fix of no migration could be found with the version number: 1. Just follow the simple steps below.

  1. Goto application/config directory
  2. Open migration.php
  3. Find $config[‘migration_type’]
  4. Change its value to sequential

Enjoy!

Codeigniter 3 Controller 404 Error

I was creating a migration for my newly developed website when I encountered this codeigniter 3 controller 404 error. When I checked my codes in routes.php and my controller class, I was surely it is correctly coded and I even check it multiple times. I also keep changing my routes but the codeigniter 3 controller 404 error, still persistent. So I dig in to codeigniter’s manual and found out a simple mistake I made. I forgot to follow the controller’s file naming convention. To fix the codeigniter 3 controller 404 Error just remember this always.

I named my migration class file to

migration.php

instead of

Migration.php

Yes, you read it right, a simple capitalizing the first letter will fix this problem. Silly me I forgot it. Anyways, again, always Capital the first letter of your controller class file.

Enjoy!

Fix Codeigniter Database Error 1064

database-error-1064

The image above shows Codeigniter Database Error 1064 which is related to Session Variables configuration that can be found in the config.php file under application/config. To fix codeigniter database error 1064, open the config.php file and find the statement

and change it to

Enjoy!