SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2003
    Location
    santa monica
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Using Limit Type Queries in PHP

    Hi I am working on a thing and I seem to have run into two major problems. First I am trying to display the say 10 newest storys from a database. The main problem is that I cannot use LIMIT because not all databases support it and I am trying to use an abstraction layer for the database. So my first question is how can I get the first 10 queries out of the database. My second question is how can I get the first 10 articles posted 10 days ago?

    Thanks For all Your Help you guys are Pros.

  2. #2
    SitePoint Member
    Join Date
    Oct 2003
    Location
    switzerland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you fetch the array row for row, you could do a simple counter that counts this 10 wanted rounds...

    do the same with a query where you do it something like this:
    PHP Code:
     SELECT FROM data WHERE Date <= $yourSelectedDate 
    netstreet.ch
    // content management made easy

  3. #3
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Data Access Object, check them out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •