Folks,
This is not my code. It’s a code to show pagination section numbers.
[code]
$total_pages = ceil($row_count/$max);
$selfpage = basename(__FILE__);
$query_params = array(
‘find’ => $find,
‘table’ => $table,
‘column’ => $column,
‘max’ => $max
);
for ($i = 1; $i <= $total_pages; $i++) {
$query_params[‘page’] = $i;
$url = $selfpage . “?” . http_build_query($query_params);
echo ‘<a href=”‘ . $url . ‘”>’;
if ($page == $i) { // shouldn’t this be $page_no?
echo ‘<b>’ . $i . ‘</b>’;
} else {
echo $i;
}
echo ‘</a>’;
}
echo ‘<b>’; echo __LINE__; echo ‘</b>’; echo ‘<br>’;
?>
It shows Google Type page Numbers: 123456789
Now, I don’t understand one bit of code:
**$query_params[‘page’] = $i;
Now where did that come from as the $query_params array has no key or value called ‘page’. If I comment-out that bit of code then the code still works. If it works without it then what’s the use of it ? Strange! Let’s call this imaginarry array value. Shall we ?