$sql = "SELECT * FROM `$table` WHERE `gender` = 'Men' LIMIT 30"; $query = $this->db->query($sql); $result = $query->result_array(); //return array