Home >Backend Development >PHP Tutorial >Mysql php can print the date of the order, but how to display it by year?
Thanks to the SF experts for their guidance https://segmentfault.com/q/10...
My order system can already print the date when the order is placed. For example,
2016-06-06 2016-06-05 2016-06-03 2016-06-01
This format
can also display the total number of transactions for the day
<code>$DONE_ORDER = mysql_query("SELECT distinct buytime FROM `buy` "); while($DONE_ORDER_ROW = mysql_fetch_array($DONE_ORDER)) { ?> <button type="button" onClick="location.href='';"><? echo date("Y-m-d",$DONE_ORDER_ROW['buytime']);?></button> <? }?></code>
But how can I display it by year?
For example
2016
2016-06-06 2016-06-05 2016-06-03 2016-06-01
2015
2015-04-06 2015-05-05 2015-03-03 2015-07-01
Thanks to the SF experts for their guidance https://segmentfault.com/q/10...
My order system can already print the date when the order is placed. For example,
2016-06-06 2016-06-05 2016-06-03 2016-06-01
This format
can also display the total number of transactions for the day
<code>$DONE_ORDER = mysql_query("SELECT distinct buytime FROM `buy` "); while($DONE_ORDER_ROW = mysql_fetch_array($DONE_ORDER)) { ?> <button type="button" onClick="location.href='';"><? echo date("Y-m-d",$DONE_ORDER_ROW['buytime']);?></button> <? }?></code>
But how can I display it by year?
For example
2016
2016-06-06 2016-06-05 2016-06-03 2016-06-01
2015
2015-04-06 2015-05-05 2015-03-03 2015-07-01