After following several Date_format instructions and operating guides, I preferred to ask for help because I tried everything and could not format the date and time output of the Mysql database. Does anyone know why this function does not work in this code? I need the time on exit 29/02/2006 20:20. In my table my date row is of type datetime.
<?php
// aqui inicia a busca de comentarios dentro do banco de dados.
require 'conexao.php';
$buscaComentario = mysql_query("SELECT * FROM comentarios WHERE identificacao = '1' AND moderacao ='nao' ORDER BY data DESC ");
while ($lista = mysql_fetch_array($buscaComentario)) {
$nome = $lista['nome'];
$site = $lista['site'];
$comentario = $lista['comentario'];
$avatar = $lista['avatar'];
$data = $lista['data'];
DATE_FORMAT('data','%d/%c/%Y %H:%i:%s');
date_default_timezone_set('America/Sao_paulo');
echo "
<div id='comentario'>
<img src='uploads/$avatar' width='80'></img>
<p><strong> $nome</strong></p>
<p>$comentario $site </p>
<span><strong> $data</strong></span>
</div>
";
}
?>
<hr/>
<?php