How to retrieve date field (mysql + php)?

0

I have a field of type date in mysql, the problem is that I can not retrieve it, by selecting it and printing only the name of it appears (date).

$dados = mysqli_query($conexao, "SELECT 'data' FROM tabela");

$res_data = mysqli_fetch_array($dados);

echo $res_data[0];

Output --- data .

    
asked by anonymous 12.08.2018 / 12:29

1 answer

0

Take the quotation marks out of the column name:

$dados = mysqli_query($conexao, "SELECT data FROM tabela");
    
13.08.2018 / 14:47