The real problem here is building something that doesn't die when you put a ton of records in that table.
If you do it with limit, offset, then the query has to build the whole return set up to that limit and throw it away. Well, at least the key value in the where clause. I.e. it has to assign a random number to EVERY ROW in the table, sort those random numbers, and THEN it can return the row.
If you know the exact size of the table (select count(*) from table can be slow, but it will give you the answer) then you can do something like:
$random = rand(0,size);
select * from table limit 1 offset $random;
That's postgresql limit offset syntax, I'm not sure how it translates into mysql's comma pair thing, I think
select * from table limit $random,1;
Notice there's no order by in this one, so it's usually much faster on large tables.