Use dbi.inc instead.
When you connect, you get a
resource handle to the db connection. Use it to address queries, for disconnecting etc. When you query, you get a
resource handle to the query result set. Use that handle when getting data from the query result, not the handle to the db connection. Once you are done getting whatever data you need from the query result resource handle, use dbi_free_result() on it. More info in dbi.inc.
Code:
new Sql:handleConnection = dbi_connect(blablabla)
new Result:handleResult = dbi_query(handleConnection, "SELECT * FROM blablablabla")
for(new i = 1; dbi_nextrow(handleResult); i++) {
dbi_field(handleResult, 1, storeresulthere) // gets data from 1st field
}