RE: Logic Problem - SOLVED but Messy
| From: | James Montz | Date: | Thu, 05 Oct 2000 21:22:48 +0000 |
| Subject: | RE: Logic Problem - SOLVED but Messy | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-db+get-3366@lists.php.net to get a copy of this message | ||
OK, it took me all afternoon, and a bit of caffeine, but I got a solution.
It just looks really messy. If some of you more experienced programmers out
there could give me some pointers on hwo to make this cleaner?
I ended up with this at the end of my previously posted code;
$offsetsave = $offset;
if ( $offset < $numrows && $numrows > $offset + $limit )
{
$offset += $limit;
echo "<p align=right><a href=\"$PHP_SELF?offset=$offset\">Next $limit
Articles</a></p>";
}
if ( $offset > $limit && $offsetsave < $numrows )
{
$offsetprev = $offsetsave - $limit;
echo "<p align=right><a href=\"$PHP_SELF?offset=$offsetprev\">Previous
$limit Articles</a></p>";
}
%>
Thanks all!
James C. Montz