DISQUS

DISQUS Hello! Patchlog is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

  • Subscribe

  • Community

  • Top Commenters

  • Popular Threads

  • Recent Comments

    • if it shows mailed by it means something is not working at the domainkeys level. Look at the message source if it has the signature in there maybe something's wrong with the DNS entries.

      7 months ago by Mihai

      in exim and domainkeys on debian

    • When testing Gmail now says 'mailed-by:' rather than 'signed-by:' Fantastic guide though! Information on how to build custom debian packages is hard to come by and this couldn't...

      7 months ago by wtb

      in exim and domainkeys on debian

    • I patched the latest version of libdkim ( 1.10.19 ) with the 2 patched from above You can download the complete patched source from : http://dkim.moogly.nl/libdkim-1.0.19-patched.tgz more info for...

      7 months ago by evolnick

      in qmail and DKIM

    • Make sure mod_rewrite in .htacces or virtual hosts configuration works first. If you managed to have pligg friendly urls work then this should work too. Look into the module's configuration it...

      7 months ago by Mihai

      in XML Sitemaps for Pligg

    • Hi Mihai, Thanks for what I expect will be a great module. Unfortunately, I'm getting the exact same results as adeel. You can see mine here...

      7 months ago by Gevaldigg

      in XML Sitemaps for Pligg

Jump to original thread »
Author

PatchLog | MySQL: counting results

Started by Mihai · 9 months ago

No excerpt available. Jump to website »

5 comments

  • var $on_page = 10;

    function listStuff($page)
    {
    $start = ($page - 1) * $on_page;
    mysql_query("SELECT * FROM stuff LIMIT $start,$on_page");
    }

    this is the idea in the list function, you can call it with different page numbers to get where you want, even to the first or last page.
  • I don't think anyone is having trouble writing those two lines of code or more.
    The idea of this post was discussing how to count the total number of results as fast as possible without putting too much load on the server on complex queries possibly joining several large tables.
  • and your code is not really correct, no to mention it doesn't do any escaping on possible user input ...
  • Oh, yeah, kinda useless comment, I misunderstood what you had to say, please delete my stupidity.

    And I know it's not correct because I said it's an idea, I didn't wrote something just from dreams, that's how I've queried for pagination, of course counting separately the total number of results.
  • too late :)

Add New Comment

Returning? Login