different every day

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2011   (RSS)

By jtedescojam - January 12, 2011

Italian word of the day... my client has posted the word and it's meaning for about 10 words and want to post more... but we want them to rotate every day. We can start with the first record and display the second record tomorow, third the day after and so on (or even randomly display one per day, whichever is easier). Please assist with the code. here's what I have now which is set for displaying them at random.

Header Code
list($italian_word_of_the_dayRecords, $italian_word_of_the_dayMetaData) = getRecords(array(
'tableName' => 'italian_word_of_the_day',
'where' => whereRecordNumberInUrl(1),
'orderBy' => 'RAND()',
'limit' => '1'
));


Body Code

<?php foreach ($italian_word_of_the_dayRecords as $record): ?><p><strong class="italianWord"><?php echo $record['italian_word'] ?></strong><?php echo $record['english_word'] ?></p><?php endforeach ?>
John Tedesco

Creative Director



JAM Graphics

Re: [Jason] different every day

By jtedescojam - January 12, 2011

Thanks Jason.. this is good enough
John Tedesco

Creative Director



JAM Graphics