We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6513
    • 28 Posts
    Hello all,
    I have a snippet that retrieves information from my DB and displays it. I need to paginate these results, but they all occur within the same document. After reading through the documentation on Ditto I am not sure if I can use it to paginate these results. It sounds like Ditto paginates documents not DB query results but I could be wrong.

    I would like to be able to have the snippet or another one create the limits and the correct number of pages from the existing document - somehow I need to snippet to create the other documents and page through them.

    Any help would be greatly appreciated smiley
      • 18913
      • 654 Posts
      I took LoopDBchunk and modified it to deal with an external MySQL database to do what it sounds like you are trying to accomplish :
      http://modxcms.com/forums/index.php/topic,14654.msg242539.html#msg242539

      With the benefit of hindsight and some experience, there is most likely a more elegant way than what I did to adapt it.
      MattC
        • 6513
        • 28 Posts
        Thanx, I’ll check it out

        EDIT
        ########################################
        My query accesses several tables at once to provide my results. Is this possible with the loopDbChunk snippet? I can’t seem to figure out if it can support multiple tables, as its params say table and the $paramArray[’table’] is not an array. Can I make it an array without having to augment the code too much? I am not very proficient in PHP yet.

        Tahnx.