Never ends for () and while () loops

I am very sorry if this was asked earlier, I looked as much as I could here, and none of these questions answered my question ...

I am trying to create a lottery of varieties ... I have a database table of members and their records, and I try to insert their names in another database table many times, how many times, as their individual number of records say.

Now I was looking for for () loops, and as far as I can understand this, this attempt of my code should work:

$Amount = mysql_query("SELECT * FROM reapingbowl WHERE userid = $reapablef->id") or die(mysql_error());


$reapablef = mysql_query("SELECT * FROM members");
  $reapablef = mysql_fetch_object($reapablef);
 $amount = $reapablef->entries

for($e = 1; $e < $amount; $e++)
{ 
mysql_query("INSERT INTO reapingbowl (userid) VALUES ($reapablef->id)") or 
die(mysql_error()); 
}

In cases where it was $amountpreviously determined to pull the number of records from the database and $reapablefpreviously determined to pull a specific user from the database table. All this is wrapped in a while loop, which runs on one user at a time.

, for() . , , , $e, , , ... () .

while, :

$Amount = mysql_query("SELECT * FROM reapingbowl WHERE userid = $reapablef->id") or die(mysql_error());


while ($amount = mysql_num_rows($Amount), $amount < $ENTRIES)
{
mysql_query("INSERT INTO reapingbowl (userid) VALUES ('$reapablef->id')") or
die(mysql_error());
}

, ... , - , , , - , ?

, . , , , for() ... ( - 10, )

+4
1

, $amount .

PHP, , .

PHP , - .

, / , .

+2

All Articles