if($numrows>0)
{
$i=0;
while($i<count($result_page[$i])) //This is line 68
{
echo "<tr>";
echo "<td>".$result_page[$i]['product_id']."</td>";
echo "<td>".$result_page[$i]['product_name']."</td>";
echo "<td>".$result_page[$i]['product_price']."</td>";
$i++;
}
}
This is the notice:
Notice: Undefined offset: 10 in /home/jatin/web/www.exam.com/admin/productlist.php on line 68.
I am getting this notice because when the loop will be executed for the last time then $i will be incremented and it goes out of the length of the array.
Each time the number of elements in the 2nd dimension changes thus I have to use count function.
The notice occurs when the condition is checked for the last time, So all my elements are displayed but the notice occurs.
Please give an appropriate solution.