We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44234
    • 219 Posts
    Hi,

    I have pdoResouces call using
    &sortby=`RAND()`
    to randomise the results. However I need to randomise the results AFTER the database query. Is this possible?

    Any help would be great
      Find me on Twitter, GitHub or Google+
      • 22840
      • 1,572 Posts
      Not sure on just one call but cant you have a pdoResouces with no sort calling a chunk with another pdoResouces in it for just the RAND and the chunk to use for display, might work ?
        • 44580
        • 189 Posts
        I'm assuming you want to do this in order to randomise a subset of the data in your table. A database-centric way of doing this is to create a view that contains the subset data and then use the same pdoResources call but on the view rather than the table.

        I'm a big fan of having the database do as much work as possible...