Jump to content


Photo

"This Date in History" script...


  • Please log in to reply
3 replies to this topic

#1 aviatorisu

aviatorisu
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 02 September 2006 - 09:09 AM

Anyone out there got something like this?  I want a script to recognize the Month and day and then compare it against database entries for events that happened on the same date through history.  I'm not very good when it comes to the whole "date" thing or I could probably get it myself.  Any help would be appreciated.

Thx,

~Z~

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 02 September 2006 - 09:20 AM

that is a realy rather simple. I think that you are trying to over think this one. I often do this my self.

Are you wanting to search by month or day or both?

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 aviatorisu

aviatorisu
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 02 September 2006 - 10:59 AM

Not even a search.  Just something to display in a small box on the front page of my site.  Something like this:

Posted Image

I think it always helps me if I can just see an example.  Lots of things I can work out for myself if I just sit down long enough, but like I said, the whole date format thing screws me up.

~Z~

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 02 September 2006 - 01:35 PM

SELECT whatever, (YEAR(CURDATE())-YEAR(event_date)) as years_ago
FROM event_table
WHERE MONTH(event_date) = MONTH(CURDATE())
AND DAY(event_date) = DAY(CURDATE())
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users