title: How to fetch data from database on modal to show detail of particular click
body: <p>I create product show page. Each row 4 product show. I have 7 product uploaded in database. So, if i click on particular product open the modal and show detail of product i clicked. I don't understand how fetch data on modal of particular product. Here's my code below. Please Help me.</p>
  
  <p>Here i fetch data to product show.</p>
  
  <pre><code>&lt;div class="row"&gt;
          &lt;div class="position-relative"&gt;
              &lt;?php
                  $sql = "SELECT * FROM wm_products";
                  $result = $conn-&gt;query($sql);
                  if($result-&gt;num_rows &gt; 0){
                      while($row = $result-&gt;fetch_assoc()){
                          ?&gt;
                              &lt;!-- start team item --&gt;
                              &lt;div class="col-md-3 padding-15px-lr team-block text-left team-style-1 md-margin-40px-bottom wow fadeInUp"&gt;
                                  &lt;div class="agileinfo_new_products_grid"&gt;
                                      &lt;div class="agile_ecommerce_tab_left agileinfo_new_products_grid1"&gt;
                                          &lt;div class="hs-wrapper hs-wrapper1"&gt;
                                              &lt;img src="products_images/&lt;?php echo $row['pro_img']; ?&gt;" alt=" " class="img-responsive" /&gt;
                                          &lt;/div&gt;
                                          &lt;p style="height:40px;"&gt;&lt;a href="single.html"&gt;&lt;?php echo $row['pro_name']; ?&gt;&lt;/a&gt;&lt;/p&gt;
                                          &lt;div class="simpleCart_shelfItem"&gt;
                                              &lt;p&gt;&lt;i class="item_price"&gt;&lt;?php echo $row['pro_price'];?&gt;&lt;/i&gt;&lt;/p&gt;
                                              &lt;p&gt;&lt;a href="" class="item_add prod_detail" data-toggle="modal" data-target="#PRODUCT_DETAILS" dataid="&lt;?php echo $row['pro_id']; ?&gt;"&gt;View&lt;/a&gt;&lt;/p&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;!-- end team item --&gt;  
                          &lt;?php
                      }
                  }
              ?&gt;
          &lt;/div&gt;
      &lt;/div&gt; 
  </code></pre>
  
  <p>Here's my modal to show product detail.</p>
  
  <pre><code>&lt;div id="PRODUCT_DETAILS" class="modal fade"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
          &lt;div class="modal-dialog" role="document"&gt;                   
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                      &lt;h4 class="modal-title" id="myModalLabel"&gt;&lt;?php echo $row['pro_name'];?&gt;&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body product_detail"&gt;
                      &lt;div class="col-md-5 modal_body_left"&gt;
                          &lt;img src="../products_images/&lt;?php echo $row['pro_img']; ?&gt;" alt=" " class="width-azset img-responsive"&gt;
                      &lt;/div&gt;
                      &lt;div class="col-md-7 modal_body_right"&gt;
                          &lt;h4&gt;&lt;?php echo $row['pro_name'];?&gt;&lt;/h4&gt;
                          &lt;p&gt;&lt;?php echo $row['pro_dis'];?&gt;&lt;/p&gt;
  
                          &lt;div class="modal_body_right_cart simpleCart_shelfItem"&gt;
                              &lt;p&gt;&lt;i class="item_price"&gt;&lt;?php echo $row['pro_price'];?&gt;&lt;/i&gt;&lt;/p&gt;                            
                          &lt;/div&gt;                  
                      &lt;/div&gt;                  
                      &lt;div class="clearfix"&gt; &lt;/div&gt;                   
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="submit" name="Add_Cart" class="btn btn-success"&gt;Add to Cart&lt;/button&gt;
                      &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>