choose 6 records from the database randomly

You could use custom SQL SELECT ... FROM my_table ORDER BY RAND()

He Fred, that's a slick idea. I was mulling over the best way to do
this -- in the course of programming an online game, I needed to pick
n contestants from a pool of arbitrary size, then narrow that to n/2
contestants, then n/4, finally ending up with just one.

Adding and indexing a random number beforehand sounds like a good way
to go. Thanks for the thought!