This is just a sample of how it works for me, you might find something easier or more suitable. Bit new at this so someone else might have a better solution. Of course swap out the myvar_id and myvar2 for whatever goes with your table design. (As I have no idea how you are setting up your pages this is the best idea I can give.)
List of items
$row['myvar_id']= $_GET['myvar_id'];
// Connect to the database.
$result = mysql_query("SELECT DISTINCT * FROM table WHERE 1 ORDER BY item ASC");
echo mysql_error();
if (mysql_num_rows($result))
while($row = mysql_fetch_array($result)) {
echo "<a href='somepage.php?id=".$row['myvar_id']."'>" . $row['item'] . " </a><BR/>";
}
somepage.php
$row['myvar_id']= $_GET['myvar_id'];
// Connect to the database.
$result = mysql_query("SELECT DISTINCT * FROM table WHERE myvar_id = '$id'");
echo mysql_error();
if (mysql_num_rows($result))
while($row = mysql_fetch_array($result)) {
echo "whatever you need here";
}