<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">  
      
    <!--- If any database errors occur during above query, --->
    <CFCATCH TYPE="Database">
      <!--- Let user know that the Films data can't be shown right now --->
      <P><I>Sorry, we can't show a real-time list of Films right now.<BR></I>
    </CFCATCH>
  </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 Rating names in a drop-down list --->
    <P>Ratings:
    <CFSELECT
      QUERY="GetRatings" NAME="RatingID"
      VALUE="RatingID" DISPLAY="Rating"/>
    <INPUT TYPE="Submit" VALUE="Go">
      
    <!--- If any database errors occur during above query, --->
    <CFCATCH TYPE="Database">
      <!--- Let user know that the Ratings data can't be shown right now --->
      <P><I>Sorry, we can't show a real-time list of Ratings right now.<BR></I>
    </CFCATCH>    
  </CFTRY>
  
</CFFORM>
      
</BODY>
</HTML>
