sanitizes sql insert and adds ability to search without type