are you sure that the variable is not overwritten in the loop? You break the inner loop (the foreach) once the variable is set but the outer loop (the section loop) is still there.
Otherwise your code looks fine to me, except that I would use a foreach for the outer loop as well.
Greetings from Luxembourg
Claudia
You must be logged in to post messages in this topic!