dessie1981
Programmer
Hi Everyone,
I am having a problem formating results from my mysql db,
I have a db of products, this includes a manufacturer column.
I would like to list the products under a manufacturer heading
. I can return the manufacturer headings but am having problem inputting the results under each manufacturer heading.
below is the code that prints the start of each table, which includes the manufacturer header.
/////this is creating an anchor of the manu's
while ($manu_row = mysql_fetch_array($manu_result))
{
echo '<a href="#' . $manu_row[0] . '"> ' . $manu_row[0] . '</a>';
}
echo '<table width="95%" border="0" align="center" cellpadding="5" cellspacing="5" summary="">
<tr>';
$manu_result2 = @mysql_query($manu_sql);
///enter loop and create manu header
while ($manu_row = mysql_fetch_array($manu_result2))
{
?>
<td colspan="6" class="product-header"><?echo $manu_row[0];?></td>
</tr>
<tr>
<td class="column-header">Part No.</td>
<td class="column-header">Description</td>
<td class="column-header">Manufacturer</td>
<td width="80" class="column-header"><div align="right">Price (€
</div></td>
<td width="80" class="column-header"><div align="right">Stock Qty</div></td>
<td width="90" class="column-header"><div align="right">Add To Cart</div></td>
</tr>
<?
}
Here is the sql that i need to include within the above loop somehow
$sql = "select * from products where part_no like '$partno%'";
I prob need to add some kind of array onto the end of this statement in order for it to step through the manufacturers.
If anyone can make sense of this, fair play to you.
Regards
Dessie
I am having a problem formating results from my mysql db,
I have a db of products, this includes a manufacturer column.
I would like to list the products under a manufacturer heading
. I can return the manufacturer headings but am having problem inputting the results under each manufacturer heading.
below is the code that prints the start of each table, which includes the manufacturer header.
/////this is creating an anchor of the manu's
while ($manu_row = mysql_fetch_array($manu_result))
{
echo '<a href="#' . $manu_row[0] . '"> ' . $manu_row[0] . '</a>';
}
echo '<table width="95%" border="0" align="center" cellpadding="5" cellspacing="5" summary="">
<tr>';
$manu_result2 = @mysql_query($manu_sql);
///enter loop and create manu header
while ($manu_row = mysql_fetch_array($manu_result2))
{
?>
<td colspan="6" class="product-header"><?echo $manu_row[0];?></td>
</tr>
<tr>
<td class="column-header">Part No.</td>
<td class="column-header">Description</td>
<td class="column-header">Manufacturer</td>
<td width="80" class="column-header"><div align="right">Price (€
<td width="80" class="column-header"><div align="right">Stock Qty</div></td>
<td width="90" class="column-header"><div align="right">Add To Cart</div></td>
</tr>
<?
}
Here is the sql that i need to include within the above loop somehow
$sql = "select * from products where part_no like '$partno%'";
I prob need to add some kind of array onto the end of this statement in order for it to step through the manufacturers.
If anyone can make sense of this, fair play to you.
Regards
Dessie