Boy my syntax on that one sure was rough... think I need another coffee!
Hope you get the idea thou, Limit is really useful for moving through
large queries ;]
Mark Green wrote:
>
> enthalpy wrote:
> >
> > i use mysql to store urls for all my images and have php query that for
> > the images. is there an easy way to set it up so it does 5 at a time and
> > has a lil next 5 link at the bottom.. the entriees in the table are not
> > numbered.
>
> Append your SQL query with LIMIT $edge, $limit";
>
> ie "SELECT blah from stuff LIMIT 0,5";
>
> select the first ten images.
> The next ten would be as such
>
> "SELECT blah from stuff LIMIT 5,5";
>
> For a link to the next 5, or previous 5 for example..do something like this:
>
> # Prints the previous 5 (if they exist!)
> if($edge >= $limit) {
> $edge = $edge - $limit;
> echo "<a href=\"http://blah/script.php?limit=$limit&edge=$edge">
> Previous Ten</a>";
> }
>
> # Prints the next 5..
> $edge = $edge + $limit;
> if($count > $edge) {
> echo "<a href=\"http://blah/script.php?limit=$limit&edge=$edge">
> next Ten</a>";
> }
>
> Sorry its a bit rough :)
> Hope you get the general idea :)
>
> ^^@rk
> << If I was a signature file, where would I be?? >>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
<< If I was a signature file, where would I be?? >>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]