Error saving with cakephp

Asked

Viewed 29 times

-2

  • If you want you can supplement the question with the Users table create

1 answer

-1


Actually the error is quite explanatory.

You put a pk on the table Users that doesn’t exist:

public $primaryKey='id_despesa';

In other words, the countryside id_expense does not exist in the table.

  • when I asked the question, I listed the fields in the users table. id_expense is the primary key of the expenses table and the primary key of the users table is id. The fk_id_user field is the foreign key to the expense table.

  • the problem is that it is trying to fetch the id_expense of the Users table, ie missing relationship of the tables a Join would solve, if this was the reason for the downvote

  • I changed the public line $primaryKey = 'id' and it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.