I am looking for a system where i pick up some values from the database based on weight but they must shuffle well and not sticking to fixed values or giving certain sets of value everytime . it should be a balanced selection and my total number of records is around 300 and growing. To make you clear letme put forward an example. Suppose i have 5 objects say a, b ,c ,d ,e with weight 1 , 2 ,3 ,4 ,5 respectively. Lets assume i m selecting 2 at a time. So chances are that 5 and 4 gets selected the most . But i want that 1, 2, 3 also comes up during the shuffle and not just 5 and 4 like static output everytime. I want to do this by pulling out directly from the mysql and not shuffling arrays from mysql query as my record set is growing day by day and wont b a good idea.Tried mysql rand , using offset , pulling out a id just greater than random generated id, but all it sux So please help experts.