Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-14-2004, 11:01 AM Date functions
Novice Talker

Posts: 9
Trades: 0
I know this is possible, I just don't know how. First off, I am storing several events in a database (date, time, location, etc.). I want to display all of them on my calendar page (not a problem), but only the events that will happen in the next 2 weeks on the main page. Any suggestions of how I should query for this? I know very little about date formatting. Thank you for any help.

The site I'm working on is ncsudrumline.com if you want to check it out.
rhythmphile is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-14-2004, 12:10 PM
Extreme Talker

Posts: 156
Location: Lincoln, UK
Trades: 0
Something like this should do the trick - if each record takes up a day

SELECT * FROM `table_name` LIMIT 0 , 14
__________________
-------------------------------------------------------------------

Please login or register to view this content. Registration is FREE
- Black Prism: Web Design - Corporate Image - Graphic Design
-------------------------------------------------------------------

Last edited by Tzunami; 04-15-2004 at 03:54 AM..
Tzunami is offline
Reply With Quote
View Public Profile
 
Old 04-14-2004, 03:34 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
If you aren't storing a day-by-day (which I would advise) then how are you storing the dates? Are you storing them as a timestamp?

If thats the case then you can generate a timestamp for 2 weeks in the future then plug it into your query as a where clause "WHERE dbtimestamp > $now_timestamp AND dbtimestamp < $later_timestamp".
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 06-14-2007, 12:53 PM Re: Date functions
Skilled Talker

Latest Blog Post:
My book update
Posts: 97
Name: Eric
Location: Las Vegas
Trades: 0
Quote:
Originally Posted by Tzunami View Post
Something like this should do the trick - if each record takes up a day

SELECT * FROM `table_name` LIMIT 0 , 14
What if there is more than one event per day?
__________________

Please login or register to view this content. Registration is FREE

Eric - M
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
peanutpad is offline
Reply With Quote
View Public Profile Visit peanutpad's homepage!
 
Reply     « Reply to Date functions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13535 seconds with 12 queries