i have created a testimonial table in database .i have inserted three testimonials. I want to show one testimonial per day.is there any good tutorial for doing this ?
CREATE TABLE customer_testimonials
( testimonial_id integer unsigned NOT NULL auto_increment PRIMARY KEY,
testimonial_text varchar(50) NOT NULL
);
You can achive this by a scheduled task. Write a (php, bash, ??) script to get max id of testimonials, generate a random number smaller than max id and writes this to the file, then run this script once for 24 hours. In your web page, always read this file to take testimonial id and query your table to get this testimonial. With this approach, you will be able to show one testimonial per day.
If you are using linux you can schedule this task by crontab.
http://adminschoice.com/crontab-quick-reference
http://php.net/manual/en/book.mysql.php
http://php.net/manual/en/function.rand.php
http://php.net/manual/en/function.fwrite.php
.
.
.