MY DEMO
I want a pagination according to the results coming from wordpress database...This is all done on my options page of wordpress plugin..
My code to re
get_var( 'SELECT COUNT(`id`) FROM `wp_dive`' );
$num_of_pages = ceil( $total / $limit );
$result = $wpdb->get_results( "SELECT `id`,`name_cust`,`gender_cust`,`dob_cust` FROM `wp_dive` LIMIT $offset, $limit" );
$data_html = '';
foreach( $result as $results )
{
$id=$results->id;
$name= $results->name_cust;
$gender= $results->gender_cust;
$dob= $results->dob_cust;
?>
";?>
". $id."";?>
". $name."";?>
".$gender."";?>
". $dob ."";?>
"?>
add_query_arg( 'paged', '%#%' ),
'format' => '',
'prev_text' => '«',
'next_text' => '»',
'total' => $total,
'current' => $paged
) );
if ( $page_links ) {
echo '' .
$page_links . '';
}
?>