--RESOLVED--
Say you have a table for entries, where entry1 has a weight of 20, and entry2 with a weight of 80. Running a query like
SELECT * FROM `entries` ORDER BY RAND() LIMIT 1
will return either of the row at random. However, I wanted to factor in weight, such that entry2 has 80% chances of being drawn and entry1 has 20%.
Is there a proper/hacky way of writing this query? Previously, I had to insert 20 entries for entry1 and 80 entries for entry2 just to have each weight well represented.