title: Load data from table using PHP & AJAX
body: <p>I'm trying to retrieve data from table using PHP and AJAX, at the moment I'm able to display the result of my query in json format, what I want to do is select an specific data from that array, for example I get this array:</p>
  
  <blockquote>
    <p>{data: [{IdProduct: "1", Name: "Name here..........",…}]}</p>
  </blockquote>
  
  <p>For example I want to select only Name, I tried doing this:</p>
  
  <pre><code>function LoadProductos() {
  
  $.ajax({
      url: '../../class/loadProd.php',
      method: 'POST',
      success: function (data) {
        var aRC = JSON.parse(data);
  
        for (var i = 0; i &lt; aRC.length; i++) {
          console.log(aRC[i].Name);
        }
      }
  
    });
  }
  </code></pre>
  
  <p>But this doesn't shows anything, how can I do this? This is my PHP code:</p>
  
  <pre><code>while($row = mysqli_fetch_array($registros)) {
  
      $table.='{
          "IdProduct":"'.$row['IdProduct'].'",
          "Name":"'.$row['Name'].'",
          "Description":"'.$row['Description'].'",
          "ImagePath":"'.$row['ImagePath'].'"
      },';
  
      $table = substr($table, 0, strlen($table) -1);
  
      echo '{"data":['.$table.']}';
  }
  </code></pre>