when i view the records from the database. the first record doesn't show on the page. when I add the second record and on, they are displayed on the page except the first record that I entered. i don't know why is that. i attached code i tried so so.
$last_insert_id = $_GET['last_id'];
this id is coming from purchase page. get the id and put select statement and view relevent record match the id.
$sql = "select i.pur_id,i.prod_id,i.buyprice,i.qty,i.total,p.date,p.total,p.pay,p.due from purchase_item i, purs p where i.pur_id = p.id and i.pur_id = '278' ";
there are 7 row data include in 278 id. but display only 6 rows
<?php
$x = 1;
$last_insert_id = $_GET['last_id'];
$sql = "select i.pur_id,i.prod_id,i.buyprice,i.qty,i.total,p.date,p.total,p.pay,p.due from purchase_item i, purs p where i.pur_id = p.id and p.id = $last_insert_id ";
$orderResult = $conn->query($sql);
$orderData = $orderResult->fetch_array();
while ($row = $orderResult->fetch_array()) {
?>
<tr>
<td class="text-center">
<?php echo $x; ?>
</td>
<td class="text-center">
<?php echo $row[6]; ?>
</td>
<td class="text-center">
<?php echo $row[3]; ?>
</td>
<td class="text-center"><?php echo $row[2]; ?></td>
<td class="text-right"><?php echo $row[4]; ?></td>
</tr>
<?php
$x++;
}
?>