Jump to content

Looping to get related records


FMDuck
 Share

This topic is 5756 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm trying to display related grandparent/parent/child records while maintaining the relationship from some of the records in an array (I'm doing one FMFind() to find multiple sets of similiar records)

My layout is associated with the time so I have one record for each showtime. The layout includes:

film::Theater //Where the film will shown

Film //Which film will be shown

Time //The showtime

TimeID //Unique ID Key

I'm trying to build a table that lists all films at a particular theater and under each, their showtimes. Ultimately I need to create a new record in a different table with the TimeID so I'm not concerned about preserving the RecID

Thanks much

Link to comment
Share on other sites

I can see the data.

I now need three arrays. The first two are based on which theater the film shows at (1 or 2). The third array that is based on a new field named IsAFilm. A record could be a film or a special event. If it's a film, it needs to parse into the $TheaterA[] array or the $TheaterB[] array. If it's a special event, the record should be skipped while building the first two arrays. The resulting records will go into a third $SpecialEvents[] array regardless of which theater it is at.

I'm trying to get the data from one multidimensional array into three 'flat' arrays. Each array should be something like;

$TheaterA = Array( $OldArray['FilmTitle'], $OldArray['Showtime'],...)

I could do this with at least 3 queries and/or some clunky code, but I'm sure there's an elequent way to do it and I don't want to end up with 'clunk'.

I can't seem to find a resource that can help with multidimensional arrays past 'apples are red and oranges are orange'. :

Thanks.

Link to comment
Share on other sites

This topic is 5756 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.