well that should do it for me i already have all the code i was unaware
that there was a limit command.. 

i should be able to do something like 
url.php?limit=0,5

or something like that 

<-----CoreComm-Internet-Services--http://core.com/----->
(Jon Marshall                 CoreComm Services Chicago)
([EMAIL PROTECTED]         Systems Engineer II)
([EMAIL PROTECTED]                   Network Operations)
<-----Enthalpy.org------------http://enthalpy.org/----->
([EMAIL PROTECTED]             The World of Nothing)
<------------------------------------------------------>

On Wed, 7 Feb 2001, 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]

Reply via email to