Fetching data from MySQL to dropdown and POSTing doesn't work
<p>I have site with signups for tournament with ladder system. Everything works except one thing. I made simple subpage to assign teams manually (need that), it is table inside form with dropdowns.</p>

<p><a href="http://prnt.sc/cdpam5" rel="nofollow">http://prnt.sc/cdpam5</a> &lt; picture of how it looks like</p>

<p>Problem is - when I pick team from dropdown list and then click Submit button, all I get are variables eg. team1, team2 when it's supposed to be "Wojtuś Pro", "kinaszonators" in this case. </p>

<p><strong>index.php</strong></p>

<pre><code>&lt;?php
        include 'db.php';

        $con = mysqli_connect($host, $user, $pass, $db);
            if (!$con) {
        die('Database connection error: ' . mysqli_connect_error());
        }

        for($i=1;$i&lt;=16;$i++){
            $sql = "SELECT team FROM lan_signups WHERE id='".$i."'";
            $result = mysqli_query($con, $sql);
            if(mysqli_num_rows($result) &gt; 0){
                $row = mysqli_fetch_assoc($result);
                ${'team'.$i} = $row['team'];
            }
            else{
                $row = mysqli_fetch_assoc($result);
                ${'team'.$i} = "brak drużyny"; // means blank
            }
        }

        mysqli_free_result($result);
        mysqli_close($con);
?&gt;
</code></pre>

<p>Is something wrong with that form? I didn't post here the whole table code, it's little bit messy and not important:</p>

<p><strong>index.php still</strong></p>

<pre><code>&lt;form name="ladder" method="post" action="done.php"&gt;
&lt;div class="tg-wrap"&gt;
&lt;table class="tg"&gt;
&lt;td class="tg-031e"&gt;1A
    &lt;select style="width: auto;" name="a1"&gt;
    &lt;option value="blank"&gt;-&lt;/option&gt;
    &lt;option value="team1"&gt;&lt;?php echo $team1 ?&gt;&lt;/option&gt;
    &lt;option value="team2"&gt;&lt;?php echo $team2 ?&gt;&lt;/option&gt;
    (...)
    &lt;option value="team15"&gt;&lt;?php echo $team15 ?&gt;&lt;/option&gt;
    &lt;option value="team16"&gt;&lt;?php echo $team16 ?&gt;&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;input type="submit" style="float:right;" value="save"&gt;
&lt;/form&gt;
</code></pre>

<p> </p>

<p><strong>done.php</strong></p>

<pre><code>$a1 = $_POST['a1'];
echo $a1;
</code></pre>

<p>This should return "Wojtuś Pro" from database but returns team1. I've tried GET and the same. I just don't know what's the reason my variable is not "transfered" to data and only variable's name is submitted.</p>

<p>Sorry if it is messy, but I am not so experienced in coding. To be clear, I want to get content from database, fill up dropdown with that, and post my choice further via form to another php and then save it to database(that i can do myself). I will be very, very grateful!</p>