I am displaying some results under one of my pages. But while I am trying to get the same result two times under the same page, it is not showing in the desired way. I have included the function file and called the function at first. Then I tried to display the same result twice. But only the first result is displaying, second one is not. Here's the code:
require 'functions.php';
$query_result=select_all_published_category();
<div class="control-group">
<label class="control-label">Parent Category Name</label>
<div class="controls">
<select name="category_id">
<?php while($cat_info=mysqli_fetch_assoc($query_result)) {?>
<option value="<?php echo $cat_info['category_id']; ?>"><?php echo $cat_info['category_name']; ?></option>
<?php }?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label">Parent Category Name 2</label>
<div class="controls">
<select name="category_id2">
<?php while($cat_info_two=mysqli_fetch_assoc($query_result)) {?>
<option value="<?php echo $cat_info_two['category_id']; ?>"><?php echo $cat_info_two['category_name']; ?></option>
<?php }?>
</select>
</div>
</div>
Can anyone help me out? Thanks