Please tell me where my problem lies??? Here is what I am trying to accomplish:
Processor 1
Item 1
Item 2
Item 3
Processor 2
Item 1
Item 2
Item 3
I have Processors in one table.
I have Items in a another table.
Here is my code:
<table width=545 border=0 cellspacing=0 cellpadding=0>
<?
$sql1 = "SELECT * FROM first_table ORDER BY id ASC";
$sql1_result = mysql_query($sql1,$connection)
or die("Couldn't execute query1.");
$sql2 = "SELECT * FROM second_table WHERE processor_code = 'processor_code'";
$sql2_result = mysql_query($sql2,$connection)
or die("Couldn't execute query.");
$list = mysql_fetch_array($sql1_result);
$id = $list["id"];
$processor_code = $list["processor_code"];
$processor = $list["processor"];
echo "
<tr>
<td colspan=4><font face=Arial, Helvetica, sans-serif size=2>$processor</font></td>
</tr>
";
while ($row = mysql_fetch_array($sql2_result)) {
$id = $row["id"];
$processor_code = $row["processor_code"];
$processor = $row["processor"];
$cpu = $row["cpu"];
$retail = $row["retail"];
echo "
<tr>
<td width=28> </td>
<td width=381><font face=Arial, Helvetica, sans-serif size=2>$cpu</font></td>
<td width=79>
<div align=right>$retail</div>
</td>
<td width=57>
</td>
</tr>
";
}
?>
</table>