Welcome Guest, Not a member yet? Register   Sign In
Set primary key when model's $useAutoIncrecement = false;
#2

(This post was last modified: 11-05-2022, 12:23 AM by InsiteFX.)

To be safe with databases we always have a Primary Key:
Code:
id int(11) UNSIGNED NOT NULL AUTOINCREMENT

Change the name of your Key to something that it reflects.
Then just add your fields to the table, your key would be just a UNIQUE KEY
In CodeIgniter set the Primary Key to id.
You should always have a Primary Key like below.

Code:
id int(11) UNSIGNED NOT NULL AUTOINCREMENT

dd
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Set primary key when model's $useAutoIncrecement = false; - by InsiteFX - 11-05-2022, 12:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB