Javascript 每次显示第一行数据的引导模型

Javascript 每次显示第一行数据的引导模型,javascript,php,ajax,twitter-bootstrap,web,Javascript,Php,Ajax,Twitter Bootstrap,Web,引导模型在循环中显示相同的数据。当我点击任何一个模型,它会显示我的第一行数据,如何解决这个问题,请帮助我 这是代码 $sql="SELECT * FROM tbl_store order by store_id DESC"; $result=mysqli_query($con, $sql); while($row=mysqli_fetch_array($result, MYSQLI_ASSOC)) { #code here } HTML代码 <td style=

引导模型在
循环中显示相同的数据。当我点击任何一个模型,它会显示我的第一行数据,如何解决这个问题,请帮助我

这是代码

  $sql="SELECT * FROM tbl_store order by store_id DESC";
  $result=mysqli_query($con, $sql);
  while($row=mysqli_fetch_array($result, MYSQLI_ASSOC)) {
     #code here
  }
HTML代码

<td style="vertical-align:middle;">
  <a href="#myModal1">
    <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#myModal1">Edit</button>
  </a>
  <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title" id="myModalLabel1">Edit Store</h4>
        </div>
        <div class="modal-body">
          <form role="form" action="editStore.php" method="POST" enctype="multipart/form-data">
            <!-- text input -->
              <div class="row">
                <div class="col-md-3 col-xs-3" style="text-align:right; color:#000000;">
                <h6>Store Name :</h6>
                <br>
                <h6 style="margin-bottom:40px; margin-top:-10px;">Description:</h6> 
                <br>
                <h6>Phone:</h6>
                <br>
                <h6 style="margin-top:0px;">Address:</h6>
                <br>
                <h6 style="margin-top:0px;">Latitude:</h6>
                <br>
                <h6 style="margin-top:0px;">Longitude:</h6>
                <br>
                <h6 style="margin-top:0px;">City:</h6>
                <br>
                <h6 style="margin-top:0px;">Country:</h6>
                <br>
                <h6 style="margin-top:0px;">Upload photo:</h6>
                <p style="color:red;">*If you want to replace</p>
              </div>
              <div class="col-md-9 col-xs-9" style="text-align:left; color:#000000;">
                <input type="text" class="input form-control" style="width:100%; margin-bottom:10px;" name="title" value="<?php echo $row['store_title']; ?>" required/> 
                <br>
                <textarea class="input input-group" rows="3" style="width:100%; margin-bottom:10px; padding-left:10px;" name="description" required><?php echo $row['store_description']; ?></textarea>
                <br>
                <input type="tel" class="form-control" style="width:100%; margin-bottom:10px;" name="phone" value="<?php echo $row['store_phone']; ?>"/>
                <br>
                <input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="address" value="<?php echo $row['store_address']; ?>" required/>
                <br>
                <div class="row">
                  <div class="col-md-6 col-sm-12 pull-left">
                    <input type="text" class="form-control" style="width:100%; margin-bottom:10px;" max="180" min="0" step="0.00001" name="lat" value="<?php echo $row['store_lat']; ?>" required/>
                      <input type="text" class="form-control" style="width:100%; margin-bottom:10px;" max="180" min="0" step="0.00001" name="long" value="<?php echo $row['store_long']; ?>" required/>
                        <input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="city" value="<?php echo $row['store_city']; ?>" required/>
                          <input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="country" value="<?php echo $row['store_country']; ?>" required/>
                        </div>
                        <div class="col-md-6 col-sm-12 pull-right">
                          <img src="<?php echo $row['store_image'];?>" style="float:right;max-height:200px;max-width:200px;">
                        </div>
                        <input type="file"  style="margin-left:15px; width:93%;" name="photo"/>
                        <input type="hidden" name="store_id" value="<?php echo $row['store_id'];?>">
                      </div> 
                    </div>
                  </div>
                </div> 
                <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                  <button type="submit" class="btn btn-primary" name="submit">Save changes</button>
                </div>
              </form>
            </div>
          </div>
        </div>

&时代;
编辑存储
门店名称:

说明:
电话:
地址:
纬度:
经度:
城市:
国家:
上传照片:

*如果要替换


"> 接近 保存更改
循环时,目标必须是一组唯一的id,该id等于id=“myModal1”。例如

//内部while循环
target=”“和id=

括号
{}
时,用于显示的html代码必须放在
内。当循环运行时,当您尝试访问
$row
变量之后,它包含上一次迭代的row,我也尝试过,但结果相同。尝试使用get variable方法并再次获取数据,但问题仍然存在:(什么是bootstrap模型?将他的答案标记为正确,您将返回帮助!target表示数据target?id表示数据id?
    //inside while loop
  target="<?php echo $row['id']; ?>" and id=<?php echo $row['id'];?>