title: Combobox in Mongodb
body: <p>I've been weeks looking for the answer about how to do a combobox in mongodb using PHP, as in MySQL would be something like:</p>
  <p>I tried using the find() method but I dont really know how to do it as I am new in MongoDB.</p>
  <pre><code>$cnx = mysqli_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;mybd&quot;);
  
  &lt;form  method=&quot;POST&quot;&gt;
      
          &lt;select name=&quot;users&quot;&gt;
          
      
          &lt;?php
          
              $usr=&quot;select * from users&quot;;
              $result=mysqli_query($cnx, $usr);
  
                  while($row=mysqli_fetch_array($result)){
  
                      $id=$row['id'];
                      $name=$row['name'];
                      $surname=$row['surname'];
                      $phone=$row['phone'];
                      $email=$row['email'];
  
                      ?&gt;
  
                      &lt;option value=&quot;&lt;?php echo $id;?&gt;&quot;&gt;&lt;?php echo $name.
                       &quot; &quot;.$surname.&quot; &quot;.$phone.&quot; &quot;.$email; ?&gt;&lt;/option&gt;
  
                      &lt;?php
                  }
  
                       ?&gt;
  
              &lt;/select&gt; 
  </code></pre>
  <p><strong>Thank you in advance and sorry for the dir*y code</strong></p>