How do you generate daily racecard details?

+1 vote
You publish a daily racecard on the website - is it possible for me to see the SQL that generates it 
so I have a good starting point for creating my own custom daily racecards?
asked Apr 24, 2011 in Smartform by betwise1 Novice (450 points)
edited Apr 26, 2011 by colin

1 Answer

+2 votes
 
Best answer
Leaving aside creating custom ratings, the racecard details themselves are easy to generate with a Smartform query as follows:

>select course, scheduled_time, name, form_figures, forecast_price from daily_runners join daily_races using (race_id) where meeting_date=CURDATE() order by course, scheduled_time;  

This fetches all racecards for the current date only, as in 'CURDATE()'.  If you want racecards for a specific course only, add course="coursename" as an AND condition in the where clause of the above query.

Of course you can also display any number of additional racecard details using the SELECT part of the query and including any of the additional fields available in daily_races and daily_runners.
answered Apr 24, 2011 by colin Frankel (19,320 points)
edited Apr 26, 2011 by colin
...