Just wondering...does anyone know of a good way to execute a SQL query, with the values weighted. At the moment I am using RAND(), but I'm trying to get it so that I can add weights to the links, to get higher showing of some adverts than others.
i.e
Link 1 - weight 1
Link 2 - weight 4
Link 3 - weight 1
Link 4 - weight 2
Link 5 - weight 1
So link 2 would be shown 4 times more than link 2 (approx), and link 4 would be shown 2 times more than link 5, but 1/2 the amount of link 2.
Anyone got any suggestions?
Cheers
Andy
i.e
Link 1 - weight 1
Link 2 - weight 4
Link 3 - weight 1
Link 4 - weight 2
Link 5 - weight 1
So link 2 would be shown 4 times more than link 2 (approx), and link 4 would be shown 2 times more than link 5, but 1/2 the amount of link 2.
Anyone got any suggestions?
Cheers
Andy