xux Posted September 20, 2006 Share Posted September 20, 2006 Hi everyone, I am trying to implement changing quote on a site everyday using php.please i need help.Thanks Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/ Share on other sites More sharing options...
Tandem Posted September 20, 2006 Share Posted September 20, 2006 We need lots of details. There is no way anyone can possibly help you going by that. Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/#findComment-95220 Share on other sites More sharing options...
xux Posted September 20, 2006 Author Share Posted September 20, 2006 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. Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/#findComment-95227 Share on other sites More sharing options...
ToonMariner Posted September 20, 2006 Share Posted September 20, 2006 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. Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/#findComment-95228 Share on other sites More sharing options...
xux Posted September 20, 2006 Author Share Posted September 20, 2006 Thanks, but how do I make sure that the quotes chanes everyday,as in replacing the quotes everyday?Thanks Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/#findComment-95233 Share on other sites More sharing options...
ToonMariner Posted September 20, 2006 Share Posted September 20, 2006 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. Link to comment https://forums.phpfreaks.com/topic/21391-displaying-new-quote-everyday/#findComment-95235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.