Hi,
I'm trying to add links using php to access my database so users would be able to scroll through the information.
I would like to have links for "next" "previous" and page "1" "2" "3" etc.
I have something like:
if ($action=="view_next") { view_next(); }
function view_next () {
global $view_start, $view_stop, $view_num, $entries;
$view_start = $view_start + $view_num;
$view_stop = $view_start + $view_num - 1;
if ($view_stop > $entries) {
$view_stop = $entries - 1;
}
}
Then a sql query to find entries from $view_start to $view_stop.
This will work once, but then the variables will not change after that. Should I use static variables? If so, where are they supposed to be declared? Is there a better way to do this?
Thanks in advance for any help or direction to other posts/articles similar to this.