CakePHP 1.3 - Unknown column in where clause

前端 未结 5 842
情话喂你
情话喂你 2021-01-18 02:02

I\'m working on an already existing cakephp 1.3 project and I needed to add a new table to the database. I have this in my controller:

    $conditions = arra         


        
5条回答
  •  無奈伤痛
    2021-01-18 02:34

    Add a $hasOne relation to Person model with Email like below

    var $hasOne = array(
        'Email' => array(
                 'className' => 'Email',
                 'foreignKey' => 'person_id' // Column defined for person ids in Email table
                 )
    );
    

    Then add

    $this->ShootingPlacement->recursive = 2;
    

    OR you can simply use joins in cakephp to join email model. Refer cakephp joining tables

提交回复
热议问题