Thanks for the replies. Being a beginner I found it vwery hard to understand what the MySQL manual was talking about. I don;t understand JOINs very well yet, not very well at all!
what I have so far is..
<?
if ($stage == "")
{
$SQL = "SELECT phot_id, phot_fname, phot_sname FROM lm_phot";
$result = mysql_query($SQL);
while($row = mysql_fetch_array($result))
{
echo "<a href=view.php?stage=2&phot=$row[phot_id]>$row[phot_sname], $row[phot_fname]</a><br>\n";
}
}
else if ($stage == "2")
{
$SQL = "SELECT phot_fname, phot_sname, coll_id, coll_title FROM lm_phot, lm_coll WHERE coll_phot = phot_id AND phot_id = $phot";
$result = mysql_query($SQL);
while($row = mysql_fetch_array($result))
{
echo "<a href=view.php?stage=3&coll=$row[coll_id]&phot=$phot>$row[coll_title]</a><br>\n";
}
}
else if ($stage == "3")
{
$SQL = "SELECT * FROM lm_link, lm_img WHERE lm_link.link_coll = $coll AND lm_img.img_id = lm_link.link_img";
$result = mysql_query($SQL);
while($row = mysql_fetch_array($result))
{
echo "$row[img_title]<br>\n";
}
}
?>
It works, but not exactly how I want it. The second page (stage=2) shows a list of the collections, and the third show the images in that collection, but I want the second page to show the first collection with links to the subsequent collection (if they exist).
Many thanks again - Mark