Ошибка в разбиении на страницы кодового указателя 1

В модели / rci_model.php

public function record_count() {
return $this->db->count_all("produk");
}

public function fetch_countries($limit, $start) {
    $this->db->limit($limit, $start);
     $query=$this->db->query("SELECT * FROM produk WHERE id_kategori='Men' order by nama_produk ASC");
        return $query->result();

    if ($query->num_rows() > 0) {
        foreach ($query->result() as $row) {
            $data[] = $row;
        }
        return $data;
    }
    return false;
}

В контроллере / sandal_clarudo.php

function sandals_for_men(){
$data['seo'] = $this->rci_model->tampil_meta(22);
$this->load->view('head', $data);
$config = array();
$config["base_url"] = "http://localhost/clarudo/index.php/sandal_clarudo/sandals_for_men/";
$config["total_rows"] = $this->rci_model->record_count();
$config["per_page"] = 5;
$config["uri_segment"] = 3;

$this->pagination->initialize($config);

$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data["results"] = $this->rci_model->
    fetch_countries($config["per_page"], $page);
$data["links"] = $this->pagination->create_links();
$this->load->view('men', $data);
$this->load->view('footer');
}

По мнению / men.php

<?php
foreach($results as $t){
echo "$t->nama_produk";
}

Я хочу показать товар, который имеет категорию только для мужчин, но используя мой код, он показывает все товары категории. Идеи?

Ответы на вопрос(3)

Ваш ответ на вопрос