By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,652 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,652 IT Pros & Developers. It's quick & easy.

Auto-update proverb once per day.

P: 23
Hi,
In my website i am trying to update proverb daily (automatically it gets changed according to our time) like this but i cant get any idea about how to update that .Can u tell me some ideas and can u give me some working examples.

thanks
Jul 20 '07 #1
Share this Question
Share on Google+
3 Replies


code green
Expert 100+
P: 1,726
Don't put off until tomorrow, what you can do today
Jul 20 '07 #2

P: 23
Sorry

I asked some idea about how to update proverb automatically in my website but u send proverb.

Don't put off until tomorrow, what you can do today
Jul 20 '07 #3

pbmods
Expert 5K+
P: 5,821
Changed thread title to better describe the problem.

Heya, kavithadevan.

Code Green was being facetious. He was implying that you could stop by TheScripts every day, and we'll supply you with a new proverb!

You have a couple of options. These are the two easiest ways that don't require scheduling scripts:

- You can display a random proverb every time the User loads the page. This is the easiest way to do it.

Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.         *
  3.     FROM
  4.         `Data_Proverbs`
  5.     ORDER BY
  6.         RAND()
  7.     LIMIT 1
- You can display a different proverb depending on what day of the year it is. This is slightly more difficult, but still pretty easy.

Expand|Select|Wrap|Line Numbers
  1. $sql = '
  2. SELECT
  3.         *
  4.     FROM
  5.         `Data_Proverbs`
  6.     WHERE
  7.         `proverbid` = \'' . (date('z') % 365) . '\'
  8.     LIMIT 1';
  9.  
Jul 20 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.