My mysql table has a createdOn column with type timestamp filedtype in the format 2011-10-13 14:11:12 .
I need to show this is a great month, year from the created column.
I was looking for a stream of stacks and was able to repeat months using the following code,
*$sqlCommand = "SELECT DISTINCT MONTH(createdOn) AS 'Month' FROM videoBase ORDER BY createdOn DESC"; $query=mysqli_query($myConnection,$sqlCommand) or die(mysqli_error()); while($row = mysqli_fetch_array($query)) { $date = date("F", mktime(0, 0, 0, $row['Month'])); echo ''.$date.' <br />'; }*
This prints months as:
October January
I need output in the format:
October 2011 January 2012
Can someone please let me know what changes I should make to the code to get the desired result.
thanks
source share