I want I retrieve a pair of columns from the same record, in a random basis. I’ve heard that Rand is very inefficient, however, so I’d like to use a different way. (Lots of articles claims so, including http://akinas.com/pages/en/blog/mysql_random_row/).
So yeah, my title pretty much says it all.
Example:
Records:
12, James, Clarinet, Chicken
16, Billy, Drums, Bacon
15, Shane, Guitar, Pizza
The system would randomly pick a record. It’ll then
echo ‘A boy named $firstname likes $favoritefood’.
Something like that. Help?
Standard disclaimer about SQL injection. This should work, but I didn’t try it: