using array to select database