In my RedpCategory table I use cat_id as primaryKey, something like in my model below
in RedpCategory model:
<?php
App::uses('AppModel', 'Model');
class RedpCategory extends AppModel {
public $useTable = 'redp_category';
public $name = 'RedpCategory';
public $primaryKey = 'cat_id';
//
//
}
in my view:
public function view($id = null) {
if (!$id) {
throw new NotFoundException(__('Invalid redeem category'));
}
$redp_categories = $this->RedpCategory->findById($id);
if (!$redp_categories) {
throw new NotFoundException(__('Invalid redeem category'));
}
$this->set('redp_categories', $redp_categories);
}
I got an error when I click on a category name link: "Undefined column: 7 ERROR: column RedpCategory.id does not exist"
How can I solve with this problem?
Any answer will be appreciated.Thank you in advanced.