The only mandatory argument is the SQL SELECT query, which can contain ? tokens. If it does contain them, the second argument must be present in form of array with the same amount of values, which are (properly escaped) placed one by one into the query. The return value is array of objects, where its attributes correspond to the names of selected columns. If the query doesn't return any row, the return value is an empty array.
There is also similar method for retrieving a single row:
Here the first row is returned as an object. If the query doesn't return any row, undefined is returned.