Finishing sql search output