reorder params for mysqli. Remove is_resource checks which don't work for mysqli