Hi Flocks....

I am developing a web site by using Joomla
And I need to get a data from data base under the following criteria

1. item should be a published (in my module published is 1 and unpublished is 0)

2. and selected data should be a shorting under the start data

I used following query for this...No problun query is executing perfectly....all the data also can display...but data not in shorting under the starting date...

SELECT * FROM `jos_jcalpro_events` WHERE `published` =1 ORDER BY 'start_date' ASC

please I am waiting your solutions
please help me.

in start_date value is having date and time together

eg: start_date = 2010-05-11 19:00:00 like this please tell me how I do this

Member Avatar for deleted1234

I think it's not sorting properly because it doesn't understand the time format of your start_date. Is it declared as VARCHAR? What you can try to do is to remove ORDER BY on your query (as in SELECT * FROM `jos_jcalpro_events` WHERE `published` =1) and add another script that checks the value of your start_date.

You may use like this select UNIX_TIMESTAMP(start_date) as mystart_date from $table order by mystart_date.

Hope this will help. If you think that simply order by with existing start_date which is not in date time type field at present is the issue.

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.