hello,
this is my code. output of this code is like this:
item amount item name
1 jacket
3 top
3 top
3 top
1 skirt
what can i do to show like this?
item amount item name
1
If the item amount is bigger than 1, i just want to show item amount only once and skip the other ones.
this is my code. output of this code is like this:
item amount item name
1 jacket
3 top
3 top
3 top
1 skirt
what can i do to show like this?
item amount item name
1
jacket
3top
top
top
1top
top
skirt
If the item amount is bigger than 1, i just want to show item amount only once and skip the other ones.
Code:
<table width="1000" align="center">
<tr>
<td>Item amount</td>
<td>Item name</td>
</tr>
<?
$query="SELECT * FROM item WHERE orderr_reference ='$ref'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$item_amount = mysql_result($result,$i,"item_amount");
$item_name = mysql_result($result,$i,"item_name");
?>
<tr>
<td><?=$item_amount;?></td>
<td><?=$item_name;?></td>
</tr>
<?
$i++;
}
?>
</table>
Comment