Added abstracted query function

Function to get all results from a query.
added ini
hmm