I have an interesting one here...

I have a website with  'seasonal' headers on it (like we've all seen
google have fun with).  I have a database that lists them with a start
date and an end date for each of them.  So, for example, I am running
my halloween header from  now until Halloween with it going back to
normal on Nov. 1.

Here's the kicker.  I have a field in my db that is called fixeddate
and it is either a 1 (if the date is always the same) or a 0 (if the
holiday floats like Thanksgiving day does).  So I have a start date
(date) field and and enddate (date) field.  I don't want to have to go
in each year and change all of the end years to the current year, that
seems stupid, in fact I could probably do some research and figure out
how to dynamically even put in Thanksgiving, but I don't want to do
that just yet.

When I query up the db for my page display, I am first just seeing if
there are any special holiday headers in the db that the current date
falls between the start and end dates.  I use the NOW()

So my query looks like this:  (hpfile name is to query up the home
page header)

SELECT
 hpfilename
 from seasonalheader
WHERE startdate<=NOW() AND enddate>=NOW()

Now is there a way I can make my database assume that if a record is
flagged as a fixed event that the year in the start date and enddate
fields assumes the current year, whatever that is?  It's almost like I
 need to come up with a way to have dynamic fields.  I think I'll go
work out and maybe my brain will figure out a better way...until then,
I thought I'd present it to you brainiacs.  Thanks in advance,
Marian




Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to