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 6323603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:32:58+00:00 2026-05-24T16:32:58+00:00

I use of codeigniter and class (library) pagination in it, why not set in

  • 0

I use of codeigniter and class (library) pagination in it, why not set in my example, column # in pagination 5 with showing?
showing in pagination 5 is-> 13 to 16 of 16 but column # in pagination 5 is -> 13 14 15.
This problem occur In befor last pagination, if last pagination is a row.

EXAMPLE: in this page you go to pagination 5 or this is direct link to pagination 5

function show($offset = 0) 
    {

    $this->admin_model->header();

    $this->load->library('pagination');
    //$this->load->library('Jquery_pagination');
    $config['base_url'] = base_url().'admin/accommodation/show';
    $config['uri_segment'] = 4;
    $config['total_rows'] = $this->db->count_all('hotel_submits');
    $config['per_page'] = '3';
    //$config['div'] = '#num_count'; /* Here #content is the CSS selector for target DIV */
    $config['num_links'] = 10000000;
    $config['full_tag_open'] = '<div id="pagination">';
    $config['full_tag_close'] = '</div>';

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

    $offset = (int) $offset; // just to make sure nothing funky gets in here
    $data['results'] = $this->db->query("SELECT @rownum:=@rownum+1 rownum, t.*
    FROM (
        SELECT *
        FROM hotel_submits
        ORDER BY id desc
        LIMIT $offset, 3    
    ) t,
    (SELECT @rownum:=0) r");

    $data['offset'] = $offset;

    ///////////////////////////HERE-START///////////////////////////////

    $curr_offset = $this->uri->segment($config['uri_segment']);
        $info = 'showing: ' . ( $curr_offset + 1 ) . ' to ' ;

        if( ( $curr_offset + $config['per_page'] ) < ( $config['total_rows'] -1 ) )
            $info .= $curr_offset + $config['per_page'];
        else
            $info .= $config['total_rows'];

        $info .= ' of ' . $config['total_rows'];

        $data['num_count'] = $info;

    ///////////////////////////HERE-END///////////////////////////////


    $this->load->view('admin/accommodation_submit_show', $data);   
    }
  • 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-24T16:32:59+00:00Added an answer on May 24, 2026 at 4:32 pm

    if( ( $curr_offset + $config[‘per_page’] ) < ( $config[‘total_rows’] -1 ) )

    should be

    if( ( $curr_offset + $config[‘per_page’] ) <= ( $config[‘total_rows’] -1 ) )

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

Sidebar

Related Questions

i use of codeigniter Why not work $this->pagination->create_links() in my code? Problem 1: I
My problem is in using Codeigniter custom library but I think it is not
I am trying to use the trackback library in codeigniter, but I am always
The class I wish to use is: https://github.com/philsturgeon/codeigniter-curl/blob/master/libraries/Curl.php How can I use this in
I am trying to learn CodeIgniter to use for a shopping site, but I
I have got a problem with my codeigniter library. To transform database data into
Im trying to use the Zend Frameworks ACL library in my code (in codeigniter)
This article explains how to use Zend in Codeigniter. http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/ I am using XAMPP
How can push a URI like this in CodeIgniter (1.7.1 currently): example.com/seg1/seg2/seg3/seg4/ or example.com/seg1/seg2/
I use CodeIgniter Image Manipulation Class to make a Thumbnail of my images. so

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.