SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error displaying results?!?

    Ive decided that the code i posted to be wrong was right after all (Its amazing what sleep can do )

    There is a problem though, heres the code again:

    PHP Code:
    $StartRow = ($PageNum 1) * 4;
    $EndRow    = ($PageNum 4) - 1
    which works with:

    PHP Code:
    .    ' LIMIT ' $StartRow .', ' $EndRow 
    Now this in theory works fine and on
    page 1 it should display 0, 3
    Page 2 = 4,7 and so on.....

    However instead of starting from row 4 on page 2 its seems to start from 0 and displays 7 results and then in the next window 7 again

    Heres the link (goto php, then sessions) Check it out



    Anyone got any ideas
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it's wrong. The second number in the limit clause is a range, not the last row.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahhh, right so the range on page 2 is 7 so it will display 7. Ok then how would i set a marker at lets says row 5, 10, 15 and so on.. (Can it be done :'( )
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YAY!!!!!!!!!!!!!!!!!!!!!!!!!!!! the info you gave me alowed me to change my code a little and now it works (well more or less )

    Its still displaying the last entry on each page as the first entry on the next page but im sure ill get round that.



    Thanks ever so much
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorted :d
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"


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
  •