im sorry im getting back to this stuff after a long break so my refrences are messed around.
I have 2 tables Table 1 stores book info
Table 2 stores ranks of the books in your case price.
So this is what i did to display my data based on ranks
$sql2 = 'SELECT * FROM `rank` ORDER BY `RankUK` ASC LIMIT 0, 100 ';
$results2= mysql_query($sql2) or die(mysql_error());
$count2 =0;
while($row2 =mysql_fetch_array($results2)){
$count2 = $count2+1;
$model =$row2['book_ISBN'];
$RankUK=$row2['RankUK'];
$RankUS=$row2['RankUS'];
$RankCAN=$row2['RankCAN'];
$sql = 'SELECT * FROM `products` WHERE `book_ISBN` = "'.$model.'"';
$result = mysql_query($sql);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
$title =$row[1];
$Author=$row[2];
$model=$row[3];
echo "<tr><td>$count2</td><td>$title </td><td>$Author</td><td>$model</td><td>$RankUK</td><td>$RankUS</td><td>$RankCAN</td></tr>";
}// edn while loop
In my case my secondary field is the book_ISBN you have to do something similar treat the price table like my rank table and then run the query for your product data inside the while loop
i hope this helps