I have a mysql query querying my database using order by RAND() LIMIT 1 to sellect a random coice from the database, however I would like to have the chance of a object being chosen increased for certain values (Weighting?)
In my database I have:
id name weight
1 Pezm 1
2 Shog 1.1
3 Ebay 1.2
4 PLp 1.3
5 php 1.4
So follwing the information in my database if a weighted random script is used php shuld be the most frequent with 1.4*the chance to get chosen, compared to Pezm,
How can this be acchieved?