A msg abaixo está aparecendo e eu não consigo resolver.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\wamp64\www\tarefa\form-edita.php on line 15 Call Stack
form-edita.php
<?php include("cabecalho.php"); include("conecta.php"); include("banco-tarefa.php"); $id = filter_input(INPUT_POST, 'id'); $con = buscaTarefa($conexao, $id) ?> <form class="criar-tarefa" enctype="multipart/form-data" action="" method="post"> <h1>Editar tarefa</h1> <table class="table table-striped table-bordered"> <?php while($dado = mysqli_fetch_array($con)){?> <tr> <td>Nome</td> <td><input class="form-control" type="text" name="nome" value="<?php echo $dado['nome'];?>" ></td> </tr> <tr> <td>Descriçao</td> <td><textarea class="form-control" name="descricao" ><?php echo $dado['descricao']; ?></textarea></td> </tr> <tr> <td>Codigo</td> <td><input class="form-control" type="number" name="codigo" value="<?php echo $dado['codigo'];?>" ></td> </tr> <tr> <td>Anexo</td> <input type="hidden" name="MAX_FILE_SIZE" value="99999999"/> <td><input class="form-control-file" name="arquivo" type="file" ></td> </tr> <?php } ?> </table> <form action="edita-tarefa.php" method="post"> <input type="hidden" name="id" value="<?=$dado['id']?>"> <button class="btn btn-info">Salvar</button> </form> </form> <?php include("rodape.php"); ?>
function buscaTarefa ($conexao,$id){
$query = "select * from tarefa where id = {$id}";
return mysqli_query($conexao,$query);
}