Hi, I'm writing an sql query on three tables which finds and displays categories and all the entries within each category
For example
Category 1 post 1 post 2 post 3 post 4
Category 2 post 5 post 6
Category 3 post 7 post 8
etc
I have the categories displaying but can only get one item from each. Can anyone suggest a better approach?
$sql = "SELECT c.CategoryDescription, f.Description, l.FileID, l.CategoryID FROM
FileCategories c, Files f, FilesLK l WHERE
c.PictureCategoryID IN (58, 59, 60, 61, 62, 63) AND
c.PictureCategoryID = l.CategoryID AND
f.ID = l.FileID
GROUP BY c.CategoryDescription";
while($row = mysql_fetch_array($result)) {
$html .= '<h3><a href="#">'.$row['CategoryDescription'].'</a></h3>
<div>'.$row['Description'].'</div>';
}
Thanks