-- Check house owner premium
local resultId = db.storeQuery("SELECT `id`, `owner` FROM `houses` WHERE NOT `owner` = 0 AND (SELECT `premdays` FROM `accounts` WHERE (SELECT `account_id` FROM `players` WHERE `id` = `owner`) = `id`) = 0")
if resultId ~= false then
repeat
local house = House(result.getDataInt(resultId, "id"))
if house then
house:setOwnerGuid(0)
end
until not result.next(resultId)
result.free(resultId)
end