View Single Post

  #3 (permalink)  
Old 08-28-2006
mootmail-googlegroups@yahoo.com
 
Posts: n/a
Default Re: mysql queries + pagination

cruiserweight wrote:
> apoogies if this is not posted in the best place. i have two tables,
> companies and websites. each web seite is categorized by design type
> (flash, xhtml, etc). what i am trying to do is previous/next links to
> go through a category. yet i have no idea how to even begin...
>
> if i select * where category ='flash', for example, how could i
> identify the next and prev row from that selection, or where siteId =
> '5' is in the list. thanks in advance.


You could use the LIMIT clause in your sql statement.
Proper syntax: LIMIT <offset>, <rows>
So, by saying, for example LIMIT 50, 25, would give you a resultset
starting at row #50 of the results, and giving you the next 25 records.

I can't really tell from your question if you are displaying each
category one-per-page, or multiple categories per page. This concept
would apply equally well to both situations, however. Just keep track
of what # category you are currently on, and use LIMIT <# of current
category>, 1

Reply With Quote