Jump to content

Archived

This topic is now archived and is closed to further replies.

xux

Displaying new quote everyday

Recommended Posts

Hi everyone,
                I am trying to implement changing quote on a site everyday using php.please i need help.Thanks

Share this post


Link to post
Share on other sites
We need lots of details. There is no way anyone can possibly help you going by that.

Share this post


Link to post
Share on other sites
Thanks,
          I have the various quotes stored in a database,i want to extract one per day to be displayed in a table as the quote of the day.

Share this post


Link to post
Share on other sites
If you have a table of quotes in your database then simply sort the query result randomly OR delete the record after it has been used for a day.

Share this post


Link to post
Share on other sites
Thanks,
          but how do I make sure that the quotes chanes everyday,as in replacing the quotes everyday?Thanks

Share this post


Link to post
Share on other sites
well if you add a field to the quotes table called something like 'date' and set it to NULL. when teh script runs check the current date. select records from the table where date is equal to the current date. If no records are returned select a random quote and update the date field for that quote with the current date.

You may if you wish delete all quotes with date < current date.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.