anchor.diff:  	String dateAfter= request.getParameter("dateSince");
   	%><p id="search">Search results where: <%
   	
  -	//String pId = ???
   	Integer pid = null;
   	//Based on tutorials at http://www.tutorialspoint.com/
  +	//Grabs pid from cookies.
   	Cookie cookie = null;
   	Cookie[] cookies = null;
   	String comp = "pid";
  
positive.code: 	  }
  	}
  
  	//Version 1, designed to be slightly easier by creating a view first, and then checking if id in view.
  
  /*
  	String createView = "CREATE OR REPLACE VIEW SUBSCRIBED_SENSORS AS SELECT DISTINCT sub.sensor_id  FROM subscriptions sub WHERE sub.person_id = " + pid;
  
  	String queryAudio = "SELECT Distinct a.recording_id, a.sensor_id, a.date_created, a.length, a.description FROM sensors sen, audio_recordings a, subscribed_sensors WHERE a.sensor_id in (select * from subscribed_sensors)";
  	String queryImage = "SELECT Distinct i.image_id, i.sensor_id, i.date_created, i.description FROM sensors sen, images i, subscribed_sensors WHERE i.sensor_id in (select * from subscribed_sensors)";
  	String queryScalar = "SELECT Distinct s.id, s.sensor_id, s.date_created, s.value FROM sensors sen, scalar_data s, subscribed_sensors WHERE s.sensor_id in (select * from subscribed_sensors)";
  */	
  	//Version 2. Goes through subscriptions itself.
  	//Had to insert brackets before the WHERE, and around query sensor.
  	//Had to remove these brackets.
  	String queryAudio = "SELECT Distinct a.recording_id, a.sensor_id, a.date_created, a.length, a.description FROM sensors sen, audio_recordings a WHERE a.sensor_id in (SELECT sensor_id FROM subscriptions WHERE person_id = "+pid+")";
  	String queryImage = "SELECT Distinct i.image_id, i.sensor_id, i.date_created, i.description FROM sensors sen, images i WHERE i.sensor_id in (SELECT sensor_id FROM subscriptions WHERE person_id = "+pid+")";
  	String queryScalar = "SELECT Distinct s.id, s.sensor_id, s.date_created, s.value FROM sensors sen, scalar_data s WHERE s.sensor_id in (SELECT sensor_id FROM subscriptions WHERE person_id = "+pid+")";
  
  	//Check if the associated sensor is found as well. 
  	//String querySensor = "(SELECT Distinct sen.sensor_id FROM sensors sen WHERE sen.sensor_ID IN (SELECT sensor_id FROM subscriptions WHERE person_id = "+pid+")";
  
   
  
  //Currently does not select any blop fields. Easily added when we have test data that has it. 
  	if (sensorType != null && !sensorType.isEmpty()) {
  	   	%>type is <%= sensorType%>, <%
  	   //sensorType = "AND sen.sensor_id = a.sensor_id AND sen.sensor_type = "+ sensorType;
  	   sensorType.toLowerCase();
  	   queryAudio = queryAudio + " AND sen.sensor_id = a.sensor_id AND sen.sensor_type = '"+ sensorType+"'";
  	   queryImage = queryImage + " AND sen.sensor_id = i.sensor_id AND sen.sensor_type = '"+ sensorType+"'";
  
negative.code: 	     Count = rsetMetaDataI.getColumnCount();
  
  %>
  //Display image data
  </table>
  <br>
  <p><u>IMAGES RESULTS</u></p>
  