Database Query Function Added