Quantcast
Channel: Most efficient way to order a list by a preset random - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Answer by FlorianH for Most efficient way to order a list by a preset random

The most efficient way probably is to create a completely random array order and cache that for every user.Except for the MySQL sollution postet above, you may use php in a very similar style: You can...

View Article


Answer by user187291 for Most efficient way to order a list by a preset random

i suppose your users have unique ids in the users table, so why not simply select * from awards order by rand($user_id)rand() can accept an argument that means 'seed'

View Article


Answer by jk. for Most efficient way to order a list by a preset random

To do the actual shuffling use Fisher-Yates shuffle algorithm. use something unique to each user to seed the prng before the shuffle.

View Article

Answer by timdev for Most efficient way to order a list by a preset random

If database table isn't very large (because this will melt your database if you're talking about more than a few rows).<?PHP$ip = $_SERVER['REMOTE_ADDR'];$sql = "SELECT * FROM table ORDER BY...

View Article

Most efficient way to order a list by a preset random

I have a online PHP system where users vote different awards for their friends, however I am finding that the awards in the middle of the page and at the bottom get less votes overall. I would prefer...

View Article

Browsing latest articles
Browse All 5 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>