All pastes #493700 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-17 21:54 UTC
rendered paste body
/**
	 * Check if an image already is added to a collection
	 * 
	 * @param 	iid	image id
	 * @param 	cid	collection id
	 * @return	Boolean
	 */
	public Boolean imageTaggedToCollectionExists(int iid, int cid) {
		String sql = "SELECT FROM " + getTagTable() + " WHERE imageid = '" + iid + "' AND collectionid = '" + cid + "'";
		
		try {
			ResultSet rs = select(sql);
			if(rs.next()) { 
				rs.close();
				return true;
			}
			rs.close();
			
			return false;
			
		}catch (SQLException e) {
			e.printStackTrace();
			
			return false;
		}
	}