I am developing point of sale in php.I have two different sales . I sold 4 mobiles in first sale and sold 2 mobiles in second sale.The following query prints 2 items on receipt.But i want to display only one item(mobile) with quantity 6??
<?php
$result = $db->query("SELECT * FROM stock_sales where date BETWEEN '$fromdate' AND '$todate' ");
while ($line = $db->fetchNextObject($result)) {
?>
<tr>
<td><?php echo $line->stock_name; ?><
<td><?php echo $line->quantity; ?></td>
</tr>}
</div>