Thanks for the explanation. Here is what is happening that I'm not sure how to correct.
Basically I'm trying to get a single row for each item in table 1. In table 2 I have the corrosponding Key plus two other fields which may be in table 2 more than once. So what I have is a row for every time the key is in table 2 instead of just in table 1.
Example
Table 1
Key | Other Field 1 | Other Field 2
111 Stuff Stuff
222 Stuff Stuff
333 Stuff Stuff
Table 2
Key | Other Field 3 | Other Field 4
111 Info More Info
111 Info More Info
111 Info More Info
222 Diffrent Info Still More Info
222 Diffrent Info Still More Info
With the way the the query is now
query("SELECT DISTINCT * FROM `Product` as t1 JOIN `Price` as t2 ON (t1.Item_Num=t2.Item_Num) WHERE Cat_Index = '$cat' AND Sub_Cat = '$cat3'")
When I loop through and display the information I get per the example below
5 rows
What I want to do is get
2 rows with the last column in each row to have a drop down box that list the OtherField3 and OtherField4 with the corrosponding information.
I have my PHP code so far any suggestions whould be greatly appreciated.
//query product table and price table
$query2 = mysql_query("SELECT DISTINCT * FROM `Product` as t1 JOIN `Price` as t2 ON (t1.Item_Num=t2.Item_Num) WHERE Cat_Index = '$cat' AND Sub_Cat = '$cat3'");
while ($row = @mysql_fetch_array($query2))
{
$variable1=$row["Pic"];
$variable2=$row["Item_Num"];
$variable3=$row["Name"];
$variable4=$row["Short_Des"];
$variable5=$row["Desc"];
$variable6=$row["Price"];
//table layout for results
print ("<tr align=\"center\">");
print ("<td><img src=\"images/products/$variable1.jpg\" height=\"64\" width=\"64\"></td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("<td>$variable5 $variable6</td>");
print ("</tr>");
}
//end
?>