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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleMost 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