Forum Moderators: coopster

Message Too Old, No Replies

Writing a script that announces: “update in!”

Any guidelines

         

henry0

11:01 pm on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What could be the best scenario to write a script that
Will query the DB (PHP/MySQL) and flags update when updated
I do not mean such a general content script like “last update...2004”.

For example a segment of my main site is a PR repository
Subdivided in PR category, each of those categories is accessible from my index.

If I find a bit of room :) on that index I would like my users to know about such updates

Thanks

Regards

Henry

mincklerstraat

7:54 am on Sep 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I were to do this I think I'd make a separate field in the main table where you keep this info that's a DATE field. Make your query grab this DATE field as well, and if it's less than x days from today, output your 'it's new!' message.

pretty straightforward. You can use strtotime for 'easiest' way of converting the date field, some other means might be more optimized - zippy fast, for getting the date you can just use mktime. strtotime will just put the date into unix format (= the number of seconds since Jan 1970 GMT) and this is the format that mktime uses too, just a simple comparison operation.

henry0

12:21 pm on Sep 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks mincklerstraat
It sounds like a good option
I shall try that route

Regards

Henry