isset() on an empty array will return true, what you want to check is ```if(!empty($result))```