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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:27:09+00:00 2026-06-16T07:27:09+00:00

I’m am trying to paginate a set of results from a database query using

  • 0

I’m am trying to paginate a set of results from a database query using $wbdb class. I’ve got it to paginate but I”m getting some freaky results and I’m not sure if this is normal. The code is printing a “>” at the top of the table for each result the query returns. Can anyone tell me what I’m doing wrong.

I’m using the following code that I got from

    $rows_per_page = 10;
    $current = (intval(get_query_var('paged'))) ? intval(get_query_var('paged')) : 1;

    $rows = $wpdb->get_results('SELECT * FROM subscriber ORDER BY sub_lname ASC');


    $start = ($current - 1) * $rows_per_page;
    $end = $start + $rows_per_page;
    $end = (sizeof($rows) < $end) ? sizeof($rows) : $end;

    $pagination_args = array(
     'base' => @add_query_arg('paged','%#%'),
     'format' => '?page=%#%',
     'total' => ceil(sizeof($rows)/$rows_per_page),
     'current' => $current,
     'show_all' => False,
     'prev_next'    => True,
     'prev_text'    => __('« Previous'),
     'next_text'    => __('Next »'),
     'type' => 'plain',
     'add_args'     => False
    );

echo paginate_links($pagination_args);

You can view the output live here http://www.thewaymultimedia.com/IML/manage-subscribers/page/2

  • 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-16T07:27:10+00:00Added an answer on June 16, 2026 at 7:27 am

    The error is in the table’s printing code. The Phone Number <td> tags are not appropriately closed.

    For example:

    <td>4085058047<td>
    

    The last tag should be </td>. This error is repeated in each row.

    You have to look for the function that prints the result and correct this.

    By the way, the total number of rows is also wrong = total+1.

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

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.