Use WorldDBQuery, CharDBQuery, WorldDBQueryTable or CharDBQueryTable.
The first two return a queryresult object which you can use the methods on you listed in the first post. Thus for instance:
Code:
local qResult = WorldDBQuery("SELECT `name` FROM `items` WHERE `quality` = 2") -- performs query and returns it as a QueryResult object
while (qResult:NextRow()) do -- fetches next row, return true on success, false otherwise (false will break the while loop)
local field = qResult:GetColumn(0) -- gets the first column of the row and returns it as a field object
print(field:GetString()) -- fetches the string from the field object and prints it, thus it prints the name of the item
end
WorldDBQueryTable and CharDBQueryTable both return a table instead. You can play around with indices of the table to get the values you want.