I’m looking to get a random row from MySQL without using too much time or resources on the system. I don’t care about weather the code given is PHP or MySQL based, however please note there are ‘gaps’ in my table.
My table columns are
‘id’ (Primary key, auto increment), varchar, int, int
I’d like it to be as random as possible
I would do it in two queries, and three steps overall.
SELECT COUNT(*) FROM your_tableSELECT * FROM your_table LIMIT 200, 1, where 200 is the random number you calculated in step 2.