If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Please help with multiple filters

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-04, 17:01
a_beginner a_beginner is offline
Registered User
 
Join Date: Dec 2003
Location: Hull, UK
Posts: 2
Red face Please help with multiple filters

Hi all,

I'm currently using Dreamweaver MX, PHP and MySQL to create a relatively simple website where I store events that are happening at skateparks throughout the UK.

My problem is that I don't have a clue about how to filter my records to show only those that are after todays date.

I have:

SELECT *
FROM news
WHERE fromDate >= 'colname' AND news.type = 'e'
ORDER BY fromDate DESC

'colname' = $_SERVER['TTOD(DATETIME())']

The event types ('e') are selected successfully, but, unfortunately, the current date thing doesn't seem to do anything.

How can I filter my recordset with current system date?

Any help greatly appreciated.

Last edited by a_beginner; 01-26-04 at 17:26.
Reply With Quote
  #2 (permalink)  
Old 01-27-04, 04:52
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
Use something like

SELECT *
FROM news
WHERE fromDate >= now() AND news.type = 'e'
ORDER BY fromDate DESC
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
Reply With Quote
  #3 (permalink)  
Old 01-27-04, 05:26
a_beginner a_beginner is offline
Registered User
 
Join Date: Dec 2003
Location: Hull, UK
Posts: 2
Thumbs up Big Thank You

omiossec (?) -- A big thank you -- that worked perfectly.

I'd read elsewhere on the web that now() didn't work -- I obviously went to the wrong site!!

Wes
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On