Hi all:
I'm totally stuck on my new problem 🙂
Basically I want to create an image gallery. I've done it many times before, however this time it is with three tables, so that's where problems start.
I have three tables:
Pixtures (ID, Path),
Categories(ID, Name),
CategorizedPix(ID,CatID,PixID)
This was done because an image can go into many cats and a cat may contain many images.
I must have three pages:
1) Show all Cats , no problem, done!
db_connect();
$sql=mysql_query("SELECT * FROM Category ORDER BY Category ASC");
while ($special=mysql_fetch_array($sql))
{
?>
<a href=cats.php?CatID=<? echo $special[0];?>>
<? echo $special[1];?></a>
<?
}
?>
2) Show all the pictures from that category.
This is the PROBLEM AREA!!!
I wanna show all the images , and their paths. I know I have to use joins, but just can't get it to work!!
3) Show picture. No problem.
db_connect();
$sql=mysql_query("SELECT * FROM Pictures WHERE ID='$PixID'");
while ($Pix=mysql_fetch_array($sql))
{
echo $special['Path'];
}
?>
----------
Thanx in advance for your thoughts!