Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with selecting a date

Status
Not open for further replies.

meeble3

Programmer
Joined
Nov 8, 2004
Messages
52
Location
GB
$result = mysql_query("SELECT DISTINCT area FROM pubs where location='VOP' (and renewal > 'CURRENT_DATE') order by county",$db);


The above query doesn't work.

What is wrong?

Thanks

James
 
How does it not work?
Can you run other queries in that code?
eg. Are you sure the code is correct?

Also, why do you have the AND inside () ?

Code:
SELECT `area` FROM `pubs` WHERE `location` = 'VOP' AND CURDATE() + 0 <= `renewal` GROUP BY `area` ORDER BY `country` ASC;

ps. above code is not tested!

I would also recommend you reading up on time and date functions that mysql can offer you:

Good luck!

Olav Alexander Mjelde
Admin & Webmaster
 
Neither of these work I'm afraid...

 
not knowing the error your getting, could the issue be with the $db?

has it been set correctly? Do you even need it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top