-1
The following errors appear when opening the table page: Notice: Undefined variable: Connection in C: xampp htdocs admin Register.php on line 283
Warning: mysqli_query() expects Parameter 1 to be mysqli, null Given in C: xampp htdocs admin Register.php on line 283
Warning: mysqli_num_rows() expects Parameter 1 to be mysqli_result, null Given in C: xampp htdocs admin Register.php on line 301
<div class="card-body">
<div class="table-responsive">
<?php
$query = "SELECT * FROM register";
$query_run = mysqli_query($connection, $query);
?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Nome</th>
<th>Protocolo</th>
<th>Data de abertura</th>
<th>Questionamento</th>
<th>Empresa</th>
<th>Observações</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($query_run) > 0)
{
while($row = mysqli_fetch_assoc($query_run))
{
?>
<td><?php echo $row['nome']; ?></td>
<td><?php echo $row['protocolo']; ?></td>
<td><?php echo $row['data']; ?></td>
<td><?php echo $row['questionamento']; ?></td>
<td><?php echo $row['empresa']; ?></td>
<td><?php echo $row['observacao']; ?></td>
<?php }
}
else {
echo "No Record Found";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
in the code shown does not actually have the $Connection variable, where it would be called?
– Geovana Ribeiro
In an external file connecting to the database.
– Pedro Abs