Database custom table issues – incorrect result displayed

Not sure why you’re getting a WSOD, but immediately I can see that in the following:

$selectedSchoolName = $wpdb->get_results( "SELECT Name FROM tblYBSSchool WHERE
SchoolID=".$SelectedSchoolID );
// get selected location name
$selectedLocationName = $wpdb->get_results( "SELECT Name FROM tblYBSLocality WHERE
LocalityID=".$SelectedLocationID );
// get route ID
$getRouteID = $wpdb->get_results( "SELECT * FROM tblYBSRoute WHERE RouteID IN ( SELECT
RouteID FROM tblYBSRouteSchool WHERE SchoolID
=".$SelectedSchoolID.")".$SelectedLocationID);

…you should be using get_var (which returns the first value of the first row, regardless of the query), not get_results (which returns an array of objects, regardless of the query).

Have you enabled debugging?