Avoid mysql error when there are no users on a sub network