Date Range Question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	I am working on an app that needs to post information to a website
based on date.  The tricky part for me is that the date is a range that
spans either 2 or 3 days.  I want the web page to dynamically populate this
information based on a query.  The query will look something like this:
	mysql("Calendar2","SELECT StartDate, StopDate, LocationID FROM
phpCalendar_Daily WHERE StartDate=CURDATE() ")

	My question is say for example the StartDate is actually Jan. 1.
The page is accessed on Jan. 2 or Jan. 3...  The  StartDate for the next
entry is Jan. 4.  How do I write this query to select the proper entry?  In
doing some research, it appears that a MySQL "SELECT CASE" might do the
trick, but I have never used this before.  The other option I can envision
is using PHP to handle the login and simply running the query, testing the
result, if NULL, run the query again with CURDATE(-1).
	Any hints, ideas, or suggestions would be most appreciated.  Thanks
in advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@sbc.com
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux