I am trying to use the XSwitch jquery script and dynamically create the "section id" automatically but am stuck.
How do I give each section an "id" starting at 0? Some items have 2 or 3 images, some have 30+.
$result = mysqli_query($conn,"SELECT * FROM Images WHERE stock=".$_GET['stock']." ORDER BY orderIndex");
while($row = mysqli_fetch_array($result)){
$count = $result->num_rows;
if ($count) {
$photos .= '<div class="section" id="section__NEED___NUMBER" style="background-image: url(inventory/'.$category.'/large/'.$stock.'_'.$row['id'].'.jpg)"></div>';
} else {
$photos = 'No Photos are currently available';
}
}