Is it possible to use zend paginator on a mysql query with random ordering?
I’m struggling to wrap my head around this one.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ORDER BY RAND() will (unsuprisingly) return random results each time it is run, so you won’t be able to paginate this in the normal way.
You would have to select ALL the data in the first run, record the order of the elements and use this on any subsequent pages. Alternatively you could just select all the data and do the pagination with Ajax. Either approach would be a fair bit of work.