i am having a problem with php and mysql. i have database in which is column Date(Y-M-D) Date is actual date field no varchar
And what i want is to change that "number" to name of that current month. For example:
2014-07-06
- 2014-07-06 / 8:00 / Need for speed 3D / Kino
2014-07-05
- 2014-07-05 / 8:00 / Need for speed / Kino
2014-06-06
- 2014-07-06 / 8:00 / The Movie / Kino
ineed change that bold date to MONTH name (what i am expecting) :
July
- 2014-07-06 / 8:00 / Need for speed 3D / Kino
- 2014-07-05 / 8:00 / Need for speed / Kino
June
- 2014-07-06 / 8:00 / movie / Kino
- 2014-07-05 / 8:00 / second movie / Kino
My code:
$result = mysql_query("SELECT hlavni.datum_expirace, hlavni.priloha, hlavni.nazev,
vedle.misto
FROM hlavni
INNER JOIN vedle ON hlavni.sekce = vedle.idecko WHERE vedle.idecko IN ( 6, 7, 8, 15, 14,
16, 17 ) ORDER BY `hlavni`.`datum_expirace` DESC, `hlavni`.`priloha` ASC");
//fetch tha data from the database
$currentDate = false;
while($row = mysql_fetch_array($result))
{
if ($row['datum_expirace'] != $currentDate){
echo
'<strong>' .
$row['datum_expirace'] .
'</strong>' ;
$currentDate = $row['datum_expirace'];
}
echo
'<ul><li>' .
$row['datum_expirace'] .
'</li><li>' .
$row['priloha'] .
'</li><li>' .
$row['nazev'] .
'</li><li>' .
$row['misto'] .
'</li></ul>';
}