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

Asked

Viewed 53 times

-1

I just want the result of one SELECT in php and I don’t know how to catch the result:

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

var_dump ("$descricao"); 

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

1 answer

1


$resultado = mysqli_query($this->conexao, "Select descricao from tabela where codigo = 1");
$linha = mysqli_fetch_assoc($resultado);
echo $linha['descricao'];
  • Now I need you to teach me how to give medals...?

Browser other questions tagged

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