I want the result of a query and in SQL it is simple ... in PHP it is confusing

-1

I just want the result of a SELECT in php and I do not know how to get the result:

$descricao = mysqli_query($this->conexao, "Select descricao from tabela where codigo = 1");

var_dump ("$descricao"); 

Return a array and how can I retrieve the field = description?

    
asked by anonymous 27.05.2018 / 22:02

1 answer

1
$resultado = mysqli_query($this->conexao, "Select descricao from tabela where codigo = 1");
$linha = mysqli_fetch_assoc($resultado);
echo $linha['descricao'];
    
27.05.2018 / 22:16