I'm doing an advertising feature on a website: The more you pay, the likelier the advert is to show.
How would I go about programming this in PHP?
I've not started at all yet because I have no idea of the implementation I could do, especially choosing the advert to display. Given that a person could bid as much money as they want, how would I make it biased towards the higher payers,
So for example, Troy payed 500 and Jane payed 1500, if they are the only two advertising right now, there's a 3/4 chance of Jane's advert showing, and a 1/4 chance of Troy's advert showing.
Given that $adverts is a mysql_query of all the running adverts with the columns: AdvertID | MoneyPayed How would I choose the ID to show?