Below is my php code I want to show data in html table by reverse order of date but it is not working where is mistake I do not find My select query is as follows
Select a.wono,date_format(b.wodt,'%Y/%m/%d') as mydate from wodtl_box a, wohdr_box b where a.wono=b.wono order by date_format(b.wodt,'%Y/%m/%d') DESC
Okay, so you are ordering by DESC
. That means it starts at the last, so that's where your mistake is. Remove the DESC
from the end of your query and you should be good to go. (ORDER BY automatically uses ASC
if DESC
is not added).
Your query would be:
Select a.wono,date_format(b.wodt,'%Y/%m/%d') as mydate from wodtl_box a, wohdr_box b where a.wono=b.wono order by date_format(b.wodt,'%Y/%m/%d')
For some more information: http://www.w3schools.com/sql/sql_orderby.asp