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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.