I need a simple solution
I have invoice that i want to always diplay 10 rows, but if there is data in mysql it must first put those rows with data in on the invoice then subtract the number of rows and the difference will be the blank rows it must add at the end.
<?php
$totala ="0";
$numrows ="10";
//QUERY
$extract = mysql_query("SELECT * FROM invoicedata WHERE invnum='$invnumber'");
//FIND DATA AND ASSIGN
while ($row = mysql_fetch_assoc($extract))
{
$items = $row['item_description'];
$prices = $row['item_price'];
$quant = $row['item_quantity'];
$itemvat = $row['item_vat'];
$subanswer = $prices * $quant;
$totala = $totala + $subanswer;
$prices = number_format($totala,2);
$subtot = number_format($subanswer,2);
$invtotal = number_format($totala,2);
echo "<table width=833 height=22 cellpadding=0 cellspacing=0>
<tr bgcolor=#FFFFFF>
<td width=325><span class=style15>$items</span></td>
<td width=122><div align=center class=style15>$prices</div></td>
<td width=107><div align=center class=style15>$quant</div></td>
<td width=139><div align=center class=style15>$vat</div></td>
<td width=122><div align=right class=style15>$subtot</div></td>
<td width=16><div align=right><span class=style15></span></div></td>
</tr>
</table>";
//$numrows = $numrows - 1
}
//INSERT BLANK LINES
//do until $numrows=0
//echo "<br>";
?>