Hi ! please help me . im having a trouble with this im actually new to php.
it says Notice: Undefined index: prev in C:\xampp\htdocs\new\viewbill.php on line 21
Notice: Undefined index: pres in C:\xampp\htdocs\new\viewbill.php on line 22 Notice: Undefined index: price in C:\xampp\htdocs\new\viewbill.php on line 23 Notice: Undefined index: id in C:\xampp\htdocs\new\viewbill.php on line 28
<?php
include 'connection.php';
$id = $_GET['id'];
$result = mysql_query("SELECT * FROM meter WHERE reading_id = '$id'");
echo "<table border='1' bgcolor='#fff'>
<tr>
<th>Id</th>
<th>Previous Reading</th>
<th>Present Reading</th>
<th>Consuption</th>
<th>Date</th>
<th>Bill Amount</th>
<th>Action</th>
</tr>";
while($row = mysql_fetch_array($result)){
$prev=$row['prev'];
$pres=$row['pres'];
$price=$row['price'];
$totalcons=$pres - $prev;
$bill=$totalcons * $price;
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $prev . "</td>";
echo "<td>" . $pres . "</td>";
echo "<td>". $totalcons."</td>";
echo "<td>" . $price . "</td>";
echo "<td>" . $bill . "</td>";
echo "</tr>";
}
echo "</table>";
?>