How to recover date field (mysql+php)?

Asked

Viewed 50 times

0

I have a date field in mysql, the problem is that I can’t recover it by selecting it and printing only appears its name (date).

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

$res_data = mysqli_fetch_array($dados);

echo $res_data[0];

Exit --- data.

  • var_dump($res_data); gives what ?

  • 2

    No need to quote the field.

1 answer

0


Remove the quotes from the column name:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.