0
Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given
I already tested the fetch_array
, fetch_object
, I don’t know how to do it.
function pegaId($nomeConteudo){
$query = "select id from conteudo where nomeConteudo = {$nomeConteudo} ";
$resultado = mysqli_query($this->conexao, $query);
$value = mysqli_fetch_assoc($resultado);
return $value;
}
I just want to receive the ID value, but it does not return to me. How to do?
--
The proposed solution did not suit my problem, although it did not return more errors making this new way:
function pegaId($nomeConteudo){
$query = "select id from conteudo where nomeConteudo = {$nomeConteudo} ";
//$resultado = mysqli_query($this->conexao, $query);
$resource = mysqli_query($this->conexao, $query);
return $resource;
}
it returns no value to me here:
$id = $conteudo_fkid->pegaId($nomeConteudo);
echo $id;
So I’m still needing to make a select, and I’m not getting it. How to proceed?
André, welcome. The question that has been marked, it contains the answer to your problem. Do the [tour] to find out how the site works, if you need help with the site’s tools, go to [help].
– NoobSaibot
You haven’t solved my problem, Noobsaibot
– André Molinari
I think I made a mistake, see: https://answall.com/questions/68124/
– NoobSaibot
I still meet with difficulty.
– André Molinari