Re: breaking up images to sets of 5

From: Date: Wed, 07 Feb 2001 01:26:29 +0000
Subject: Re: breaking up images to sets of 5
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38469@lists.php.net to get a copy of this message
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) (jonathon.marshall@core.com Systems Engineer II) (enthalpy@core.com Network Operations) <-----Enthalpy.org------------http://enthalpy.org/-----> (enthalpy@enthalpy.org 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?? >> >

« previous php.general (#38469) next »