Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6908243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:32:17+00:00 2026-05-27T08:32:17+00:00

I am having problems with CodeIgniter pagination module. When I go to click on

  • 0

I am having problems with CodeIgniter pagination module.

When I go to click on the links I get a 404 error. As I understand and I may be incorrect, but it would seem that the URI segment which determines the offset is not being read inside the index function of my controller and that code igniter is actually looking for this as a function inside the controller hence throwing the 404 when it cant find it.

I have googled around and checked on the forum to find a solution but have not had any success. If anyone has any hints or tips that would be great I have included the relevant code from my controller, model and view below.

//Controller

$this->load->library('pagination');
$config['base_url'] = '/yourhistory/';
$config['total_rows'] = $this->db->get('gallery')->num_rows();  
$config['per_page'] = 3;
$config['uri_segment'] = 2;
$this->pagination->initialize($config); 
$data['galleryitems'] = $this->pages_model->get_gallery($config['per_page'], $config['uri_segment']);
$this->load->view('/gallery', $data); 

//Model

function get_gallery($limit, $segment)
 {
  $query = $this->db->get('gallery', $limit, $this->uri->segment($segment));
  if ($query->num_rows > 0)
  {
   foreach($query->result() as $row)
   {
    $data[] = $row;
   }
   return $data;
   }
 } 

//View

 echo $this->pagination->create_links(); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:32:18+00:00Added an answer on May 27, 2026 at 8:32 am

    Well its going to fail first off because of your base_url:

    $config['base_url'] = 'http://example.com/index.php/test/page/';
    

    You need the full path, altho I am just guessing here as you don’t provide the URL that is throwing the 404.

    Notes on pagination here: http://codeigniter.com/user_guide/libraries/pagination.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im having problems starting a codeigniter project, the problem is that when i do
Im having problems with classpaths. I have used them before with import but I'm
I'm having problems trying to connect my website to Facebook. What I would like
Having a problem with image manipulation in codeigniter - it bombs when I get
I am having difficulties implementing the codeigniter pagination class. I have created my model,
I having problems with DataGrid component: It shows en-US date-format (mm/dd/yyyy), but the CultureInfo.CurrentCulture
Having problems getting the different arrays content from geocoder results. item.formatted_address works but not
Im having a few problems with the form_dropdown function in CodeIgniter .... My application
I'm having some problems learning how to program proper URLs in codeigniter ... im
I'm trying to implement modular extensions into a codeigniter 2 setup but am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.