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

  • Home
  • SEARCH
  • 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 9182385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:32:52+00:00 2026-06-17T18:32:52+00:00

Try for hour but not working. I can manually switching the /welcome/index/1 or 2

  • 0

Try for hour but not working. I can manually switching the /welcome/index/1 or 2 or 3 in the URL. Just the damn pagination < 1 2 3 4 > not showing !

My controller

        $offset = $this->uri->segment(3,0);

    $query = $this->db->query(
        'SELECT p.id AS pid,
                p.url, 
                p.created_time,
                t.name,
                t.num_photo,
                t.id AS tid
        FROM photos p
        LEFT JOIN tag_maps AS tm ON p.id = tm.photo_id
        LEFT JOIN tags AS t ON t.id = tm.tag_id
        INNER JOIN
        (
            SELECT MAX(created_time) maxDate, t.id
            FROM photos p
            LEFT JOIN tag_maps AS tm ON p.id = tm.photo_id
            LEFT JOIN tags AS t ON t.id = tm.tag_id
            GROUP BY t.id
        ) AS d
        ON p.created_time = d.maxDate
        AND t.id = d.id
        ORDER BY p.created_time LIMIT ' . $offset . ',2'
    );
    $config['base_url'] = 'http://localhost:8080/example/welcome/index';
    $config['total_rows'] = $query->num_rows();
    $config['per_page'] = 2;
    $config['num_links'] = 20;

Then in my html

<?php 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-06-17T18:32:54+00:00Added an answer on June 17, 2026 at 6:32 pm

    The problem is lied on this

    $config['total_rows'] = $query->num_rows();
    

    You can’t use the $query->num_rows();, as this is always return 2 rows.
    You should have another query to get the total rows for the actual query,
    which should be a SELECT COUNT(*)

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

Sidebar

Related Questions

My emulator and SDK package were working fine literally one hour ago. I try
Apologies if this is really stupid, but I just can't figure out how to
I'm not that good in OOP or even C# but I want to try
Try to see which cast is faster (not necessary better): new c++ case or
Not quite sure if it is ok to do this but, my question is:
I have been working at this one for an hour. I have tried several
First of all, I have already tried adding flag_activity_new_task, still its not working. Here
i have a form where a user can select timing intervals. But I only
Well I have an alarm that should be called every day, but its not
It would make sense if I was in a ±5 hour timezone, but I'm

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.