1
Hello, I need to sort randomly result of my query and display pagination using mysql. Ordering and paging are working perfectly.
Always when paging is done, on account of the use of ORDER BY RAND();
results are random and repeated in paging.
I would like to know how to use the ORDER BY RAND();
so that the records are always presented randomly in each query (not necessarily in each page) without repeating in the following pages.
SELECT * FROM tabela1 WHERE Id= $id ORDER BY RAND() LIMIT $inicial,$final
@Everson put it, but the example is indifferent because it is the way to use the randomized result with paging that is the question. Records cannot be repeated on subsequent pages. The random has to be done once in the result of the query without paging.
– lelopes
the display is normally done with php, calculating the pagination correctly with the initial number of records, all right.
– lelopes