title: Get Json from php jquery Ajax
body: <p>Php file </p>
  
  <pre><code>&lt;?php global $ajax_recieve;
      if(isset($_POST['values'])){
          $ajax_recieve = $_POST['values'];
      }
      $result = mysqli_query($read_info,"SELECT Namn FROM information WHERE Namn LIKE ('".$ajax_recieve.'%")";
      $resultSet = array();
      while($row = mysqli_fetch_array($result)) {
          $resultSet[] = array( 'Name'=&gt; $row['Namn']);
      }
      $json = json_encode($resultSet);
      echo $json;
  ?&gt;
  </code></pre>
  
  <p>JS file</p>
  
  <pre><code>$(document).ready(function(){
      $('#search').on('input', function() {
          var inputSearch = $('#search').val();
          $.ajax({
              type: "POST",
              contentType: "application/json; charset=utf-8",
              datatype: 'json',
              url: "createJSON_list.php",
              data: {values: inputSearch},
              success: function(response){
                  $.each(response, function(){
                      $('#json_datalist').append(response[0]);
                      console.log(response[0]);
                  });
              }
          });     
      });
  });
  </code></pre>
  
  <p>I cannot see value in console.log. Or I get only last data from database. I need a array which must be append to a html datalist as an array.</p>