• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
It is required that the primary_key be called "id"?

I was doing a simple crud with ci4 and everything went very well until I noticed that to eliminate some element of a table from the forced field table the primary_key has to be called "id"

This is the function that I use to eliminate

elimination of public functions ($ key) {
$ this-> crud_model-> delete ($ key);
return redirect () -> to ("/ crud");

When I see the error between a system / Model.php and I see that there is a global variable called primaryKey with "id" as the default value.

My question is, what should I do to be able to use that function without my primary key field being called "id"?

Excuse me for my english, greetings from Cuba

Messages In This Thread
It is required that the primary_key be called "id"? - by cjam - 08-19-2018, 02:01 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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