private ArrayList<String> getclashedModules(String name) {
		// String part is module ID that it's clashed with, integer is how many
		// students take that module.
		try{
        	openDatabase();
		}catch(Exception e){}
		String query = "SELECT name FROM t8005t2 .modules WHERE ID IN (SELECT ForeignID FROM t8005t2 .clashedModules WHERE moduleID IN (SELECT ID FROM t8005t2 .modules WHERE name= '"
				+ name + "'))";
		ArrayList<String> clashedModules = new ArrayList<String>();

		try {
			stmt = conn.createStatement();
			ResultSet rs = stmt.executeQuery(query);
			while (rs.next()) {
				String foreignID = rs.getString("name");
				clashedModules.add(foreignID);
			}
		} catch (Exception e) {
			System.err.println("Problem executing getclashedModules query");
			System.err.println(e.getMessage());
		}
		try{
        	closeDatabase();
		}catch(Exception e){}
		return clashedModules;
	}