Topic awaiting preservation: MySQL PHP - weighting random row selections (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Northumberland, England |
posted 06-10-2003 16:10
I'm looking for a way to randomly select rows from a MySQL database, giving preference to more recent additions in the database. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 06-10-2003 16:54
smonkey: You want it random but with some kind of weighting towards more recent entries?! |
Paranoid (IV) Inmate From: Northumberland, England |
posted 06-10-2003 17:02
Why? well because on a site i'm working on there is supposed to be four random images chosen from a database of past projects - obviously random is good, but if the randomness is weighted slighty towards the more recent projects then the more current and therefore better stuff will be shown more often - makes perfect sense |
Maniac (V) Inmate From: under the bed |
posted 06-10-2003 18:14 |
Paranoid (IV) Inmate From: everywhere |
posted 06-10-2003 19:47
Give the most recent entries a points score in a multidimensional php array, for example: |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 06-10-2003 20:48
yeah... usual strategy for this is |