PHP MySQL pagination with random ordering

后端 未结 6 1596
生来不讨喜
生来不讨喜 2020-12-05 11:25

This is a problem with a ordering search results on my website,

When a search is made, random results appear on the content page, this page includes pagination too.

6条回答
  •  臣服心动
    2020-12-05 11:41

    I would have your PHP generate your random record numbers or rows to retrieve, pass those to your query, and save a cookie on the user's client indicating what records they've already seen.

    There's no reason for that user specific data to live on the server (unless you're tracking it, but it's random anyway so who cares).

提交回复
热议问题