Tour Selection  
   
   
   

 

 

 

 

  Tour Selection  
 

NConnect($hostName,$username,$password); $query = " SELECT distinct category_id FROM Category"; $recordSet = $conn->Execute($query); //Check for errors if (!$recordSet) print $conn->ErrorMsg(); else { print "

Please select a category from the drop down list

"; //Notice how it calls itself print "

"; print "

" ; $recordSet->Close(); # optional // print "


"; print "


"; } //Create the Query // Start a query ... $query = "SELECT t.category, t.tour_code, t.day_of_week, t.description, t.cost_per_person FROM tour t "; if ($category != "All") { //Note the literal abound $regionName $query .= " Where t.category = '$category'"; } // ... and then complete the query. $query .= " ORDER BY t.category"; //Get the recordset $recordSet = $conn->Execute($query); if (!$recordSet) print $conn->ErrorMsg(); else print "

Our Tours From $category

"; print ""; print ""; // print " "; //Format the information into a table using table/cell tags while (!$recordSet->EOF) { print ''; $recordSet->MoveNext(); } $recordSet->Close(); # optional $conn->Close(); # optional ?>

CategoryTour CodeDay of weekDescriptionCost per personRegion
' .$recordSet->fields['CATEGORY'] .''.$recordSet->fields['TOUR_CODE'] .''.$recordSet->fields['DAY_OF_WEEK'] .''.$recordSet->fields['DESCRIPTION'] .''.$recordSet->fields['COST_PER_PERSON'] .'