I am 3 days beating headache with a problem: I have some tables in the system and this error happens in the most improbable screens.
I'll give you the latest example:
2015-03-13 16:37:51 Error: [PDOException] SQLSTATE [42S22]: Column not found: 1054 Unknown column 'CadRepresentante.id' in 'field list' Request URL: / lhasa / auxiliary / situacao_banco / edit / 18
# 8 C: \ xampp \ htdocs \ lhasa \ app \ Controller \ BankController.php (87): Model-> read (NULL, '18')
# 9 [internal function]: SituationBancoController-> helper_edit ('18 ')
The AuxSituationBank table has $ hasMany binding with CadPropose, but no binding with CadRepresentant! If I remove the link with CadProposta in the model of AuxSituacaoBanco, stop giving the editing error, but then in CadProposta, which has $ belongsTo connection, it starts to give error of the AuxSituacaoBanco.
I no longer know what to do to solve this problem!
AuxSituacaoBanco:
public $hasMany = array(
'CadProposta' => array(
'className' => 'CadProposta',
'foreignKey' => 'aux_situacao_banco_id',
)
);
CadProposta
public $belongsTo = array(
...
'AuxSituacaoBanco' => array(
'className' => 'AuxSituacaoBanco',
'foreignKey' => 'aux_situacao_banco_id',
),
...
);