res will be populated with the results of the query