WordPress uses three extra tables for that: wp_terms, wp_term_relationships and wp_term_taxonomy.
To keep it simple in CI, just use the tables categories and post_categories.
Categories holds all your categories; where every categorie has a unique ID.
Post_categories holds the post_id and the category_id.
When saving your post, insert the categories into the post_categories table.
User the CI query_builder functions to get all posts that have a specific category.
E.g.:
Code:
$query = $this->db
->select('t1.*')
->select('t3.category_name')
->from('posts t1')
->join('post_categories t2','t1.id = t2.post_id')
->join('categories t3','t2.category_id = t3.id')
->get();