[thelist] RE: sql.table structure for site I am bidding on...

john corry john at neoncowboy.com
Mon Jan 7 13:07:57 CST 2002


hey guys,

Sorry to be a dunce, but...

<snip rudy's pseudocode>
this is a classic 1-to-many query

select filmTitle
      , showings.showingDate
      , showings.showingTime
      from films, showings
     WHERE showings.showingDate
           <= DATE_ADD('2002-01-06', INTERVAL 14 DAY)
      AND films.filmID = showings.filmID

let's call the query "john" so that i can access the values in the columns
of the result set with that qualifer

so here's pseudocode for nested output --

set thisTitle=''
loop
   get the next resultset row
   if thisTitle <> john.filmTitle
      {  /* print the new title */
         thisTitle=john.filmTitle }
   /* print the showing */
end loop
</snip>


OK...this is exactly what I needed, and if it were simple dumping contents
to a page, I'd be there. But I have to format the output, which means I have
to conditionally close a table cell. I cna't figure it out...

I need to print the movie info (title, desctiption, rating, showtime) then,
if its the same movie, print the other showtimes. Then, close the <td> &
<tr>.

I can't figure out the nesting of the if's to make the </td> </tr> close
when the row is done printing.

any hints? thanks,
John






More information about the thelist mailing list