Not necessary, but I think these three lines could be replaced with this:
return $db->QueryItem($sql)