title: Fetching data from MySQL database to html drop-down list
body: <p>I search for answers here but haven't found a solution. 
  I have also added picture of the error.
  I want the data to go to the first drop-down list ( above the error)
  I think the method I try to perform is also create drop-down list, am I correct? </p>
  
  <p></p>
  
  <pre><code>           &lt;form name="message" action="" method="post" onsubmit="" accept-charset="utf-8"&gt;
                 &lt;div class="form-group"&gt;
                     &lt;label id="senderName"&gt;שם השולח:&lt;/label&gt;
  
  
  
                 &lt;/div&gt;
              &lt;div class="form-group"&gt;
  
                  &lt;label for="to_user"&gt;מען:&lt;/label&gt;
                  &lt;select name="to_user" class="form-control"&gt;
                      &lt;option value="pick"&gt;בחר מהרשימה&lt;/option&gt;
                          &lt;?php
  
                          $sql = \mysqli_query("SELECT name From users");
                          $row = mysqli_num_rows($sql);
  
  
                              echo "&lt;select name='to_user'&gt;";
                              while ($row = mysqli_fetch_array($sql)){
                                  echo "&lt;option value='". $row['name'] ."'&gt;" .$row['name'] ."&lt;/option&gt;" ;
                              }
                              echo "&lt;/select&gt;" ;
  
                          ?&gt;
  
                  &lt;/select&gt;
  
  
              &lt;/div&gt;
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/9uOJP.png" rel="nofollow">picture of the error</a></p>