paginate_links outputs a ">" character for each result
-
I am using wpdb to query a custom table. Then I am looking to paginate those results using paginate_links().
I am getting a “>” character at the top of the table in my code. Here is my code
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 = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;$rows = $wpdb->get_results(‘SELECT * FROM subscribers ORDER BY 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);
and here is a link to the page
https://www.thewaymultimedia.com/IML/manage-subscribers/I’ve been at it for a few hours and just can’t figure out my mistakte. I”m using WordPress 3.5
- The topic ‘paginate_links outputs a ">" character for each result’ is closed to new replies.