title: Fetch array for dropdown list with MySQL data in a form
body: <p>How can i start it? I know that i need to make an mysql query, but how to transform data, in options in the dropdown list. And remember, it's inside a form, to send the result from a MySQL table. </p>
  
  <p>(EDIT)</p>
  
  <p>I am working inside a printf That is what i want:</p>
  
  <pre><code>&lt;?php ob_start();
  include('/../../config.php'); 
  
  if(isset($_POST['edit_id']) &amp;&amp; !empty($_POST['edit_id'])) { 
  
  $edit_id = mysql_real_escape_string($_POST['edit_id']); 
  $result = mysql_query("SELECT username, password, nome, cidade, pais, base, isactive,   admin, dov, checador, dinheiro, email, datanascimento, profissao, idivao, idvatsim, horas, rank FROM acars_users WHERE `id`='".$edit_id."'");
  $resultdl = mysql_query("SELECT * FROM acars_hubs");
  
  $data = mysql_fetch_array($result);
  $dl = mysql_fetch_array($resultdl); 
  
  
  printf("&lt;div  align=\"center\"&gt;
  &lt;br&gt;&lt;form method=\"post\" action=\"editar2.php\"&gt;
  &lt;p&gt;&lt;font size=\"2\" face=\"Segoe UI, Arial, Helvetica, sans-serif\"   align=\"center\"&gt;Modifique os campos que deseja para &lt;strong&gt;editar este membro.&lt;/font&gt;&lt;br&gt;
  &lt;br&gt;
  
  &lt;table width=\"700\" border=\"0\" align=\"center\" &gt;
  &lt;tr&gt;
      &lt;td&gt;Base Operacional:&lt;/td&gt;
      &lt;td&gt;&lt;label for=\"hub\"&gt;&lt;/label&gt;
        &lt;select name=\"hub\"&gt;
           &lt;option&gt;".$dl['name']."&lt;/option&gt;
         &lt;/select&gt;
      &lt;/td&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;&lt;/br&gt;&lt;/br&gt;
  &lt;input name=\"edit_id\" value=\"$edit_id\" type=\"hidden\"&gt;
  &lt;input type=\"image\" src=\"img/Editar.PNG\" width='85' height='30'&gt;&lt;/form&gt;
  &lt;/form&gt;
  
  &lt;/table&gt; 
  &lt;/div&gt;
  
  ");
  while ($data = mysql_fetch_array($result));
  while ($dl = mysql_fetch_array($resultdl));
  ob_end_flush();
  ?&gt;
  </code></pre>