views:

37

answers:

2

Hi,

I have an SQL listing shops, but i would like to random the results on a daily basis.

For example today I list bat 2, 6, 9 etc and tomorrow, 6,1,7,9 etc

Is there a way to implement this?

A: 

Is this for a website or...?

You could set up a cron job to run a script on a daily basis and change something to make different shops show up.

For example, you could create a table that contains the ID numbers of shops you want to show, and when your cron job runs it would delete all records from that table and insert new ones, determined randomly or however you want.

Hammerite
yes this is about a website ..... i will think about this, maybe by creating a coloumn with holding a random number that will change daily.
mouthpiec
+1  A: 

With mysql you can write a query like this

select * from table order by rand(curdate()) limit 3

You can adapt it to other rdbms if you need.

nick rulez