<div class="modal fade validate" id="modal-6">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Edit Advertisement</h4>
                <label class="idhere"><?php echo $id; ?></label>
            </div>
            <?php $sel = $d->select('advertisements', 'ad_id=12');
            while ($result = mysqli_fetch_assoc($sel)) {
            ?>
                <div class="modal-body">
                    <div class="row">
                        <div class="form-group col-md-6">
                            <label class="control-label">Image Upload</label>
                            <div>
                                <div class="fileinput fileinput-new" data-provides="fileinput">
                                    <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;" data-trigger="fileinput">
                                        <img src="<?php echo $result['photo']; ?>">
                                    </div>
                                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px"></div>
                                    <div>
                                        <span class="btn btn-white btn-file">
                                            <span class="fileinput-new">Select image</span>
                                            <span class="fileinput-exists">Change</span>
                                            <input type="file" name="advertise_photo" accept="image/*">
                                        </span>
                                        <a href="#" class="btn btn-orange fileinput-exists" data-dismiss="fileinput">Remove</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-info">Send</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
                </div>
            <?php } ?>
        </div>
    </div>
</div>
I am unable to set the value of input type=file from database, and if the image is exits then change button appear instead of select image. when i am choosing new file it works properly,and change and remove button appear instead of select file. Please help me to solve it.
 
     
    