On row click display rows below with more data on that entry

Hi I have a search bar which takes user input and searches a database. The search results appear in a table. Is it possible to be able to have the user click a row in the table and have more rows of data relating to that entry appear below?
How would I connect the current database to the further information database?
And how would I code the on row click event?