title: PHP load data in modal depending on the user picked item
body: <p>How can the data from a PHP Bootstrap modal dialogue be loaded?
  In this case, products are dynamically loaded on the page. A User can click on any of the items, and depending on which item user clicked, Bootstrap modal should load the data of that clicked item.</p>
  
  <p>PHP Code:</p>
  
  <pre><code>$products = Product::byCategory($category-&gt;id);
  while ($product = $products-&gt;fetch(PDO::FETCH_OBJ)) {
      echo '&lt;div class="row"&gt;';
      echo '&lt;div class="col-md-7"&gt;&lt;b&gt;' . $product-&gt;name . '&lt;/b&gt;'; 
          if($product-&gt;is_vegi == YES){echo ' &lt;img src="//dy3erx8o0a6nh.cloudfront.net/images/diet_veg_17px.png" alt="Vegetarian" class="iconVegetarian"&gt;';}
      echo "&lt;br /&gt;" . $product-&gt;description . "&lt;/div&gt;";
      echo '&lt;div class="col-md-5"&gt;';
      echo '&lt;div class="row"&gt;';
      echo '&lt;div class="col-md-offset-3 col-md-4"&gt;&amp;pound;' . $product-&gt;price . '&lt;/div&gt;';
      echo '&lt;div class="col-md-3"&gt;&lt;input type="text" maxlength="2" name="qty" id="qty' . $product-&gt;id . '" class="form-control custom-control input-sm" value="1" readonly /&gt;&lt;/div&gt;';
      echo '&lt;div class="col-md-2"&gt;&lt;button type="button" id="' . $product-&gt;id . '" class="showModalForPizza btn btn-info btn-xs" data-toggle="modal" data-target="#pizzaDetails"&gt;&lt;i class="fa fa-wrench"&gt;&lt;/i&gt; Change&lt;/button&gt;&lt;/div&gt;';
      echo "&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;";
  }
  </code></pre>
  
  <p>ID is stored in <code>id="' . $product-&gt;id . '"</code> full line below</p>
  
  <pre><code>echo '&lt;div class="col-md-2"&gt;&lt;button type="button" id="' . $product-&gt;id . '" class="btn btn-info btn-xs" data-toggle="modal" data-target="#pizzaDetails"&gt;&lt;i class="fa fa-wrench"&gt;&lt;/i&gt; Change&lt;/button&gt;&lt;/div&gt;';
  </code></pre>
  
  <p>The target data is the data stored in the modal with the matching ID. What is the best way to load this data?</p>