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
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
and also edit view.php, edit.php to $post['post_id']
Thx