public static Message[] getNotesForRecipient(Connection con, int user_id,
			int message_type) throws SQLException {
		ResultSet rs = con.createStatement()
				.executeQuery("SELECT m . * , users.username FROM messages AS m INNER JOIN (SELECT * , MAX( sent_on ) AS time_stamp FROM messages WHERE recipient = "
						+ user_id
						+ " GROUP BY sender) AS q ON m.sender = q.sender AND m.sent_on = q.time_stamp INNER JOIN users ON m.sender = users.id ");
		return parseResults(rs);
	}