[thelist] php/mysql get next two records

Mark Groen markgroen at gmail.com
Mon Feb 7 08:13:59 CST 2005


> > Can you use TOP in mySQL?
> [/snip]
> 
> No, but it does support a "LIMIT" clause which does the same in it's
> simplest syntax:
> 
> SELECT
>         <whatever fields>
> FROM
>         myTable
> WHERE
>         myField => myCriteria
> ORDER BY
>         myField
> LIMIT 3
> 
> (It does have to be specified after the ORDER clause.)
> 
> For more details:
> http://dev.mysql.com/doc/mysql/en/select.html

I think I will try Burhan's idea, the records may need a wee bit of
extra sorting and pulling them all out for one day in a chunk would
work for that, (there isn't something on every hour, lots of blank
spots), thanks everyone!

I rather do like the sql way though, more elegant...hmmm

-- 
cheers,

             Mark

             MG Web Services
             www.mgwebservices.ca

Your Canadian West Coast web site development and hosting solution.


More information about the thelist mailing list