$error isn't needed, really.. Now if there's single issue, this message won't be shown. Just use

    if (!$nb_items) ...

That will do it.