This question already has an answer here:
I want to fetch date format from (y,m,d) to (d,m,y).In my database I already insert data like date and images so many around 400 images.I dun want to insert again.
The following is to fetch from database.
- <?
- $sql = "SELECT * FROM ShowFillter GROUP BY Image_Date order by Image_Date desc";
- $objQuery = mysql_query($sql) or die ("Error Query [".$sql."]");
- while($objResult1 = mysql_fetch_array($objQuery))
- {
- ?>
- <li class="filter" data-filter="<?=$objResult1['Image_Date'];?>">
- <a href="#">
- <?=$objResult1['Image_Date'];?></a>
- </li>
-
- <?
- }
- ?>
The following is i tried it out to fetch from database.But It only show (Year ,Month,day) format.
- <?
- $sql = "SELECT * FROM ShowFillter GROUP BY DATE_FORMAT(Image_Date, '%d/%m/%Y') order by DATE_FORMAT(Image_Date, '%d/%m/%Y') desc";
- $objQuery = mysql_query($sql) or die ("Error Query [".$sql."]");
- while($objResult1 = mysql_fetch_array($objQuery))
- {
- ?>
- <li class="filter" data-filter="<?=$objResult1['Image_Date'];?>">
- <a href="#">
- <?=$objResult1['Image_Date'];?></a>
- </li>
-
- <?
- }
- ?>
Here is the result
Is it possible to fetch (day,month,year) format?
If its possible ,guide me please.
Thanks :)
</div>