Jump to content

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
https://forums.phpfreaks.com/topic/307617-not-all-list-are-being-populated/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.