-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Description
Hi,
First of all, Thank you for the good lecture :),
Beacause Table posts and categories has same column name "id"
$this->db->order_by('posts.id', 'DESC');
$this->db->join('categories', 'categories.id = posts.category_id');
get_posts METHOD return id is categories.id
so when edit post it is not working properly.
I changed Model
**$this->db->select('posts.*, posts.id as post_id, categories.*');**
$this->db->order_by('posts.id', 'DESC');
$this->db->join('categories', 'categories.id = posts.category_id');
and also edit view.php, edit.php to $post['post_id']
Thx
Metadata
Metadata
Assignees
Labels
No labels