Fetch data from same named two columns of two tables

According to the CodeIgniter documentation the database select method accept a single argument. The correct syntax for the select is then:

$this->db->select('*, category.name as cat_name');