For 10000 order numbers, the required order numbers range from 0 to 9999, completely random and irregular.

thanks

Mar.24,2021

create an array of size 10000, fill in 0-9999 times, and then scramble it with random numbers


const arr = [];
for(let i=0;i<10000;iPP){
    arr.push(i);
}

function random(arr){
    if(arr.length===0){
        return null;
    }
    const index = Math.floor(Math.random()*arr.length);
    return arr.splice(index, 1)[0];
}

random (arr) you can get random numbers

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e67561-4545b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e67561-4545b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?