I have a variable that is a line with divs in html. and I'm trying to include in it a number that starts with one and automatically increases, so that each div is numbered in ascending order.
while ($row9 = mysqli_fetch_array($query, MYSQLI_ASSOC)) { $catname9 = $row9["catname"]; $statusid9 = $row9["id"]; $i = 1;
this is my while ^^
this is my row that i repeat until it reaches the end of my named sql vv table
$list9 .= '<div id="each9" style="margin-top:3px" onclick="moveTo(\'.main\', '.$i.');"></div>
then i echo
<?php echo $list9; ?>
since i do the first 1, then the second repeat 2 and the third repeat 3
source share