Hi there,

I am new to this and have a little issue I cannot quite work out.

I have two tables

Table name: gallery
gallery_id, title, description, featured, created

Table name: gallery_images
image_id, gallery_id, image, caption, image_order

I want to list the contents of the gallery table and call the images related to each field from the gallery images table.

PHP Code:
$gallery = new DataConn// pre set to connect to db
$gallery->query("SELECT gallery.gallery_id, title, description, featured, image FROM gallery LEFT JOIN gallery_images ON gallery_images.gallery_id = gallery.gallery_id AND image_order = 0");

while (
$rs_gallery mysql_fetch_array($gallery->result))
{
    
    echo 
$rs_gallery['title'];
    echo 
$rs_gallery['image'];
?> 
This displays the title of each entry in the database and only one image associated with it.

How can I loop through the images held in gallery_images and display them under each title?

Any help would be great thank you,