I can not see the elements of a table row

0

I'm trying to view elements of a row in my table, only separately. And I have not been successful.

Follow the code:

<?php

require_once("conexao.php");

$id = $_POST['idlicita'];

$query = "select * from licitacao where idlicita = $id";

$resultado = mysqli_query($conexao,$query);
$visu = mysqli_fetch_assoc($resultado);

echo $visu["objeto"];

Excerpt from the form where the ID corresponding to the item I want to display is passed:

<form action="visualiza.php" method="post">
  <input type="hidden" name="idlicita" value="<?$licitacao['idlicita']?>">
  <button type="submit" class="btn btn-success">Visualizar</button>
</form>

EDIT:

Error giving:

  

Warning: mysqli_fetch_assoc () expects parameter 1 to be mysqli_result,   boolean given in C: \ xampp \ htdocs \ panelnovo \ pages \ view.php on   line 10

    
asked by anonymous 29.09.2017 / 17:40

1 answer

0

As @Isac said, problem is that you have an error in the code, you lack = in <?$licitacao['idlicita']?> . Because of this, it is sending the variable empty and can not fetch it.

    
29.09.2017 / 19:04