If you read documentation on queryDB you will find parameter $oneRow.
This parameter adds extra checks into your code that your query DOES the right thing. Please use it in the line above.

Also I'm not sure that your code will work at all. Have you even tested your changes ?
Without $oneRow parameter you will expect a table returned back represented in a 2 dimensional array. So if you want to get a value it would be something like $value = $row[0]['value']; because $row would be an array of rows actually and not the first row.

Could you please explain me how your code works because I might be missing something.