Hey guys,
Does anyone know how to make a cronjob randomly pick a set number of items in a database? Like say if people enter a competition, it puts it in a table, then at whatever time the cronjob is set to it randomly picks six of those entries? I have absolutely zero insight so any tips and I would be deeply grateful.
PHP & Cron
Moderator: General Moderators
- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT * FROM table ORDER BY RAND() LIMIT 6- SilverMist
- Forum Commoner
- Posts: 65
- Joined: Tue Mar 02, 2004 2:06 pm
- Location: Canada
- Contact: