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 > mysql date operation problem??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-07, 05:29
PHPycho PHPycho is offline
Registered User
 
Join Date: Jan 2007
Posts: 1
mysql date operation problem??

I am trying to display all the news which are up to todays date. I have used following query but didnt get the success

PHP Code:
$sql "SELECT * FROM news WHERE news_date < = todays_date"
May be i have not enough knowledge about date operation in mysql. What i want is just your help .
Thanks a lot.
Reply With Quote
  #2 (permalink)  
Old 01-15-07, 07:28
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
dunno where you coulda got "todays_date" from

try CURRENT_DATE which is the standard sql function (and also works in mysql)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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