Welcome Guest, Not a member yet? Register   Sign In
select whit random? help :)
#4

[eluser]jedd[/eluser]
Side-note : using random sort order is expensive, especially on big tables.

Typically it will be faster to calculate the number of rows you have in the table, use a PHP function to calculate n random numbers within that range, and modify your SELECT to use a 'WHERE IN ( ... )' construct.

Yes, I do note you say ten items will exist in this particular table, but it's not clear if that's an immutable set of data.


Messages In This Thread
select whit random? help :) - by El Forum - 10-14-2009, 08:26 AM
select whit random? help :) - by El Forum - 10-14-2009, 08:31 AM
select whit random? help :) - by El Forum - 10-14-2009, 03:35 PM
select whit random? help :) - by El Forum - 10-14-2009, 04:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB