added code to query database and display results in a table