I am new to PHP but it seems to me like another version of C. The rand() function produces an almost random number.
Just set the function to the min and max value of your choices. If you have ten choices, 1 to 10, that is what to set it to.
But a database does not store records in any order. That is why the "order by" is there.
My point is that if you have 100 entries in a db, using a random number makes no difference. If you use a select to find the needed records, they come out in no particular order unless you program it to.
Some DB's have a default value to sort by, often the primary key. If mysql has this, your rand() function would work as you mean it to.
arelgee