About the $I PP operation of while?

what I do when I generate an order is:

while ($row = mysqli....) {
$id = substr(date("YmdHi", time()), -10);
}

because there will be dozens of orders in one second
, but this will lead to the same order number
. I have thought about using "uniqid" or some other way, but what I want to do now is

.

assuming that the number of while has 5
, it can be added to the number using $iPP. For example,
18113019151
18113019152
18113019153
18113019154
18113019155

anyway, it starts at 1 and ends with while.
it"s just that I try to do this:

$i = 1;
while ($row = mysqli....) {
$id = substr(date("YmdHi", time()), -10).$i;
$iPP;
}

but there are no numbers, is it impossible to do so? How can that be achieved?

Feb.11,2022

in this way, it is possible

$i = 0;
while (.... {

$iPP;
}
Menu