I am trying to populate a database table with over 1,000 rows of data (random generated numbers). My code:
$input = new Card($request->all());
$i = 1;
while($i <= 1000 ){
$input->pin = intval( "2" . rand(100,999) . rand(10000,99999) );
$input->save();
$i++;
}
The problem is that only one data is sent to the database.
I also tried this for
loop too with:
$input = new Card($request->all());
for($i=1; $1<= 1000;$i++ ){
$input->pin = intval( "2" . rand(100,999) . rand(10000,99999) );
$input->save();
}
And the same problem, only one row affected.