Jump to content

Not all list are being populated


bbram

Recommended Posts

I have a list that pulls information from a database.  This information is pulled dynamically.

There are 4 different list and all 4 different list display the exact same thing...the issue is that only the first list is populating items.   I have pasted code below as an example for two of the list.

<select name="Winning_Player_1" size="1">
	<?php $sql=mysqli_query($con, "Select Player_Number, Player_Name from players order by Player_Name");
		while ($row = $result->fetch_assoc())
		{
			 unset($Winid1, $WinPlayer1);
			 $Winid1 = $row['Player_Number'];
			 $WinPlayer1 = $row['Player_Name']; 
			 echo '<option value="'.$Winid1.'">'.$WinPlayer1.'</option>';
		 }?></select>	</td>
    <td>Winning Player 2
      <select name="Winning_Player_2" size="1">
      <?php $sql=mysqli_query($con, "Select Player_Number, Player_Name from players order by Player_Name");
		while ($row = $result->fetch_assoc())
		{
			 unset($Winid1, $WinPlayer1);
			 $Winid1 = $row['Player_Number'];
			 $WinPlayer1 = $row['Player_Name']; 
			 echo '<option value="'.$Winid1.'">'.$WinPlayer1.'</option>';
		 }?></select>

 

Any help is greatly appreciated with this.

 

What I plan on doing is passing each variable to another page and see if the winning players exists and if not then process my next set of code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.