All pastes #494528 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-18 09:22 UTC
rendered paste body
/**
	 * Delete the link between an image and a collection. Returning 1 if the link is deleted,
	 * 0 when the link didnt exist.
	 * 
	 * @param 	iid image id
	 * @param 	cid	collection id
	 * @return	integer 1 on success, 0 when no rows were affected
	 */
	public int deleteImageFromCollection(int iid, int cid) {
		String sql = "DELETE FROM " + getTagTable() + " WHERE imageid = '" + iid + "' AND collectionid = '" + cid + "'";
		
		return delete(sql);
	}
	
	/**
	 * Delete the link between an image and a location. Returning 1 if the link is deleted,
	 * 0 when the link didnt exist.
	 * 
	 * @param 	iid image id
	 * @param 	cid	location id
	 * @return	integer 1 on success, 0 when no rows were affected
	 */
	public int deleteImageFromLocation(int iid, int lid) {
			String sql = "DELETE FROM " + getLocationTable() + " WHERE imageid = '" + iid + "' AND locationid = '" + lid + "'";
			
			return delete(sql);
		}
	}