Create function to display data from database