2015년 1월 4일 일요일

How to load second dropdown list frommongodb collection after first dropdown list is changed

I have floor collection in mongodb. floor have name and room no. i was write a php query within html drop down box for list out the floor name .query is
<select class="select">
  <?php
$collection = $db->floors;
$cursor = $collection->find();
  if($cursor){ 
  foreach($cursor as $rec){
echo"\n";?>
<option>  <?php echo $rec['name']; ?> </option>
<?php }
                                         }
    ?> 
  </select>
now i want select room list based ob floor name

this html form is display the room no list
<label class="col-sm-4 control-label">Room Number</label>
<div class="col-sm-8">
<select class="select">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
</select>
</div>

how can i write a query for selection room no . pls anyone help me.advancein thanks



This is a wrong mailing list for this kind of questions. You may want to check on StackOverflow for answers. 


댓글 없음:

댓글 쓰기