Hi
I have two tables that look like this:
EVENTS:
event_num
event_name
venue_name
streetaddress1
town
county
event_description_ire
event_description_eng
event_date
event_time
IMAGES:
image_id
event_id
category
image_path
There are event records in the EVENTS table and associated images in the IMAGES table. The two tables are linked on the EVENTS.event_num and IMAGES.event_id fields. What I want is an sql statement that retrieves one record from the EVENTS table and all of the associated image records from the IMAGES table. Then the next record from the EVENTS tables and all of it's images and so on.I'm finding this quite hard to do. I wrote an sql statement within an sql statement to do this but it didn't work. Then I tried a join but it retrieves an EVENT record and keeps repeating it on the page for every image it finds.
I suppose what I need is for an event record to be found and displayed on the page and then for all of the associated image records to be found and displayed before it goes to the next event record. Any ideas?
I have two tables that look like this:
EVENTS:
event_num
event_name
venue_name
streetaddress1
town
county
event_description_ire
event_description_eng
event_date
event_time
IMAGES:
image_id
event_id
category
image_path
There are event records in the EVENTS table and associated images in the IMAGES table. The two tables are linked on the EVENTS.event_num and IMAGES.event_id fields. What I want is an sql statement that retrieves one record from the EVENTS table and all of the associated image records from the IMAGES table. Then the next record from the EVENTS tables and all of it's images and so on.I'm finding this quite hard to do. I wrote an sql statement within an sql statement to do this but it didn't work. Then I tried a join but it retrieves an EVENT record and keeps repeating it on the page for every image it finds.
I suppose what I need is for an event record to be found and displayed on the page and then for all of the associated image records to be found and displayed before it goes to the next event record. Any ideas?