0
I’m trying to pass a variable, but it doesn’t appear on the screen.
The mistake...
Notice: Undefined index: operador_mapa in C: xampp htdocs Sistema Views form_mapa_continua.php on line 58
Here’s where I call the job:
$nome = $busca_mapas->busca_mapa($id);
Here is the function:
public function busca_mapa($id){
$conexao = Database::getConnection();
$busca = "SELECT * from mapa WHERE cod_mapa = $id;";
$mapa = $conexao->query($busca);
$retorno = $mapa->fetchAll(PDO::FETCH_ASSOC);
return $retorno;
}
Here is the html code where I print the variable (and that’s where, too, the error appears):
<div class="disabled field">
<label>Nome do operador</label>
<input value="<?= $nome['operador_mapa'];?>" placeholder="<?=$nome['operador_mapa']?>">
</div>
The bank:
I can assure you that there is data in the bank.
Can you var_dump the $name and post here the result please?
– Vinicius Gabriel