boa noite, estou com erro de php ,eu queria listar uma tabela mas eu só queria mostra os resultado da pessoa logada.mas com código abaixo ele me retorna esse erro
(Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean ugiven in C:\xampp\htdocs\super\eti\vieweti.php on line 39)
estou tentado criar uma tabela que mostre resultado de 3 coluna em uma tabela no banco
variável esta sendo alimentada certo $idUsuario no echo
linha que fica indicado esse erro:
while($res = mysqli_fetch_array($result)) { ...
}
<?php session_start(); ?>
<?php
if(!isset($_SESSION['valid'])) {
header('Location: login.php');
}
?>
<?php
//including the database connection file
include_once("../connection.php");
$idUsuario = $_SESSION["id"];
echo $idUsuario ;
//fetching data in descending order (lastest entry first)
$result = mysqli_query($mysqli, "SELECT * FROM etiqueta WHERE idemp=".$idUsuario." ORDER BY id DESC");
?>
<html>
<head>
<title>Homepage</title>
</head>
<body>
<a href="../index.php">Home</a> | <a href="../add.html">Add New Data</a> | <a href="../logout.php">Logout</a>
<br/><br/>
<table width='80%' border=0>
<tr bgcolor='#CCCCCC'>
<td>Name</td>
<td>Quantity</td>
<td>Price (euro)</td>
<td>Update</td>
</tr>
<?php
while($res = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>".$res['nome']."</td>";
echo "<td>".$res['texto']."</td>";
echo "<td>".$res['idemp']."</td>";
echo "<td><a href=\"edit.php?id=$res[idetique]\">Edit</a> | <a href=\"delete.php?id=$res[idetique]\" onClick=\"return confirm('Are you sure you want to delete?')\">Delete</a></td>";
}
?>
</table>
</body>
</html>