I'm only getting the first row from database
<?php require('testconfig.php') ?>
<html>
<head>
</head>
<body>
<?php
$sql="SELECT * FROM item ";
$sqlll=mysqli_query($conn,$sql) or die ("cant fetch data");
$result=mysqli_fetch_assoc($sqlll);
?>
<table border='1'>
<tr>
<td>r.no</td>
<td>name</td>
<td>prices</td>
</tr>
<?php
while ($row=mysqli_fetch_assoc($sqlll))
{
echo "<tr>";
echo "<td>".$result['RNO']."</td>";
echo "<td>".$result['ITEMNAME']."</td>";
echo "<td>".$result['PRICE']."</td>";
echo "</tr>";
echo "<br/>";
}
?>
</table>
</body>
</html>
What I supposed to get is that show all result from query on html table by looping.
this is my table name=test
-------------------------------------
r.no |itemname |price |leftinstore |
-------------------------------------
1 |ball |98.45 |4 |
-------------------------------------
2 |book |90 |7 |
-------------------------------------
3 |food |68.98 |4 |
-------------------------------------