Hi all...

I am a developing a website using a joomla.

I need to display a content but the should filter according to the date.

I need only display content which are in between current date and before 30 days.

my current mysql quary is

SELECT * FROM events WHERE published =1 ORDER BY start_date ASC

in the data base there are tow fields to store date which are start date and end date

the dates values are storing like follow

start_date = 2010-05-11 19:00:00

end_date = 2010-20-01 19:00:00

this format can not change and it should be keep this format

So my dear friends how I do this...please help me

Thank you all
Cheers.

Umanda Jayo Bandara

Recommended Answers

All 3 Replies

Use :

SELECT * FROM events where published =1 and date(start_date) between date(now()) and date_add(date(now()),interval 30 day) ORDER BY start_date ASC

Hope it helps !

Hei my dearest friend it is working thank you very much....

You are most welcome. Please Close this post as solved :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.