• This topic has 6 replies, 6 voices, and was last updated 8 years ago by dazh.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Any PHP dudes fancy helping me out?
  • sharkbait
    Free Member

    I’ve got a simple page that returns results from a mysql search but the results are not paginated yet.
    I could figure out how to do this but it would take time as I’m not a very good at it, and I’ve got a potential client looking at it very very soon.
    Anybody fancy chucking some code into it to paginate the results or pointing me at some code that I could use?

    nemesis
    Free Member
    sharkbait
    Free Member

    Cheers Nemesis – seen that one, I’ll take a look.

    lemonysam
    Free Member

    I’m not a php guy but it’ll be pretty trivial to write your own version. You need three numbers: The number of results you want to show (n), the page number you’re on (p) and the total number of results (t).

    Use LIMIT n , n*(p-1) in the sql to get the results and use ceil(t/n) to get the total number of pages. Quick for x < numberOfPages loop to render the paging links and bob’s your uncle.

    sands
    Free Member

    nemesis – Member

    Pie chart anyone?

    SO reminded me of this (which may have been on STW years ago)
    It has a few sweary bits – but it’s good

    I Wish I Worked With This Man…He’s Hilarious

    gatsby
    Free Member

    PHP threads are never as funny as Photoshop threads… 🙁

    dazh
    Full Member

    I’ve got a potential client looking at it very very soon.

    So you have a potential client but haven’t yet figured out how to limit the number of results from an SQL query? Are you sure you’re doing things in the right order? 😯

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Any PHP dudes fancy helping me out?’ is closed to new replies.