while ($row = mysqli_fetch_array($aa)){
$public_order_id = date("Ymd", time()).rand(1,999999);
because there will be more than one br in an instant.
my current idiotic approach is to use rand.
, but 1999999 still has a chance to reproduce, because it uses while to generate a list!
so maybe the first generation will be 222, and the 20th will have a chance of 222!
because it is not useful to use time (), the time will be exactly the same, too fast
unless the generated list exceeds 20, the number of digits may be + 1
and it has to be compared with the database. If there is a duplicate, go back to the previous step and reproduce it.?
I have an ID that can be viewed by programmers, so I use AUTO_INCREMENT
but now I want to generate
that I want people to see. Do you want to think about a better way?