title: unable to show return data via ajax call
body: <p>I have created a query it was working before but when i tried to get data in json format though it is not working i do not know why it is not showing data in return here is my code. when I checked the console the return data is not showing though not even it is processing I think so but I am unable to rectify the problem the bug. can any one please help me out.</p>
  
  <pre><code>$(document).ready(function(e) {
      $("#addcart").on('submit', (function(e) {
          var oldval   = $('#crtcount').text();
          var form     = this;
          var formData = new FormData(this);
           $.ajax({
              url         : "includes/get_data.php",
              type        : "POST",
              data        : formData,
              contentType : false,
              cache       : false,
              processData : false,
              dataType    : "JSON",
              success     : function(data) {
                  var data = $.parseJSON(data);
                  $('#crtcount').html(parseInt(oldval)+1);
                  $('#crtcount1').html(parseInt(oldval)+1);
                  $('#cart_dt').html(data.cart);
                  console.log(data.message);
              }
          });
      }));
  });
  </code></pre>
  
  <p>his is my php code which I have created for processing the data</p>
  
  <pre><code>$qty = $_POST['qty'];
  $pid = $_POST['pid'];
  echo $cart-&gt;add_to_cart($pid);
  
  $data['message']  = "&lt;div class='message'&gt;Your product is added to cart&lt;/div&gt;";
  $data['cart']     = '';
  foreach($_SESSION['cart']['pid'] as $content) { 
      $prod_id          = $content['prod_id'];
      $products         = bgMysqlSelect("SELECT * FROM bg_products WHERE pid = '$prod_id'");
      $data['cart']    .= '&lt;div class="items-sm"&gt;&lt;div class="img-sm"&gt;&lt;img src="../includes/uploads'.$products['pimage'].'" /&gt;&lt;/div&gt;';
      $data['cart']    .= '&lt;div class="cart-inf-sm"&gt;&lt;h4&gt;'.$products['ptitle'].'&lt;/h4&gt;';
      $data['cart']    .= '&lt;p&gt;&lt;span&gt;price :&lt;/span&gt;$'.$products['pmsrp'].'&lt;/p&gt;';
      $data['cart']    .= '&lt;p&gt;&lt;span&gt;Qty :&lt;/span&gt;'.$content['qty'].'&lt;/p&gt;';
      $data['cart']    .= '&lt;a href=""&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;';
  }
  
  echo json_encode($data);
  </code></pre>