<HTML>
<HEAD><TITLE>Film Information</TITLE></HEAD>
<BODY>
<H2>Film Information</H2>

<!--- Create self-submitting form --->
<CFFORM ACTION="#CGI.SCRIPT_NAME#" METHOD="Post">

  <!--- Attempt database operation --->
  <CFTRY>
    <!--- Retrieve Films from database --->
    <CFQUERY NAME="GetFilms" DATASOURCE="#REQUEST.DataSource#">
      SELECT FilmID, MovieTitle
      FROM Films
      ORDER BY Films.MovieTitle
    </CFQUERY>
    
    <!--- Display Film names in a drop-down list --->
    <P>Films:
    <CFSELECT
      QUERY="GetFilms" NAME="FilmID"
      VALUE="FilmID" DISPLAY="MovieTitle"/>
    <INPUT TYPE="Submit" VALUE="Go">
      
    <!--- Silently catch any database errors from above query --->
    <CFCATCH TYPE="Database"/>
  </CFTRY>


  <!--- Attempt database operation --->
  <CFTRY>
    <!--- Retrieve Ratings from database --->
    <CFQUERY NAME="GetRatings" DATASOURCE="#REQUEST.DataSource#">
      SELECT RatingID, Rating
      FROM FilmsRatings
      ORDER BY Rating
    </CFQUERY>  

    <!--- Display Ratings in a drop-down list --->
    <P>Ratings:
    <CFSELECT
      QUERY="GetRatings" NAME="RatingID"
      VALUE="RatingID" DISPLAY="Rating"/>
    <INPUT TYPE="Submit" VALUE="Go">
      
    <!--- Silently catch any database errors from above query --->
    <CFCATCH TYPE="Database"/>
  </CFTRY>
  
</CFFORM>
      
</BODY>
</HTML>
