I'm fairly new also but seeing as no one has answered I will try to help yo as best I can. I can't give you 100% correct syntax but more of a good idea on which way to go. What I would do is this.
This is from my understanding of the question you asked even though it may be something completely different. Please elaborate more. "my understanding is cpname will be the same for the images in the same row"
Now I guess running two loops should work at this point I recomend making another table that is a sort of catalogue that only has 1 pack name and how many different ones there are to organize them into rows
im talking about a table like this example name is cptypes
CPTYPE:
CPNAME (primary)
DATE // if you want to late add options to show most recently added
thats about all thats needed
a for each loop will suffice
//run a query to the table with each type
$query2 = mysql_query("SELECT * FROM cptypes");
//Now this while statement will show all of each type in there seperate table, making them rows would be too hard cause of the whole alignment issue
while ($myquery2=mysql_fetch_array($query2)) {
//get variables ... the below will return what cpname is for the particular loop
extract($query2);
//run a query to get all the types that meet a specific name as outlined in the cptypes table.
$query3 = mysql_query("SELECT * FROM cptypes WHERE cpname=$cpname");
echo "<table><tr>";
while ($myquery3=mysql_fetch_array($query3)){
<td>$cpname <BR> $price <BR> $description <BR> </td>
}
echo "</tr></table>"
}
The syntax is probably all wrong and this probably makes no sense but hopefully you picked up what im trying to do.
the while loops return all the variables from each row via column name. if you want me to try to explain more post. or pm me.
if someone finds this is completely wrong please let me know so I can delete it.