Code for retrieving data from database. (JohnD & ChrisO) Login works