I have while loop inside another while loop and inside another while loop. This echoes products by categories and categories by groups. Simplified example code is below:
$a=0;
while(2 > $a) {
echo "<div><h3>Group</h3>";
$b=0;
while(5 > $b) {
echo "<label>Category</label>";
echo "<select name='productID_".$b."'>";
$c=0;
while(10 > $c) {
echo "<option>product</option>";
$c++;
}
echo "</select><br/>";
$b++;
}
echo "</div>";
$a++;
}
What I need is that select name continues in another group and doesn't start from 0 again.
For example now if I have 2 groups with 2 product categories each then in first group select names will be productID_0 and productID_1 but in second group also. I need it in second to continue with productID_2 and productID_3.
How to do that?
$bto0every time through the outer loop.