in reply to I don't understand error message

$result's value is undef, because ->next_result() returned undef, probably because there isn't a next result.