title: JSON PHP data returning null
body: <p>I am trying to fetch a PHP script using AJAX and return the values as JSON. For some reason, my script fails and I am trying to figure out the problem. When I enter a value from the database into the address bar, like: </p>
  
  <pre><code>www.someaddress/post.php?kinaseEntry=aValue
  </code></pre>
  
  <p>I get a JSON output like so:</p>
  
  <pre><code>{"kinaseSKU":null,"url":null,"molecularWeight":null,"tracerSKU":null,"antiSKU1":"antiSKU1","antiSKU2":"antiSKU2","bufferSKU":"bufferSKU","tracerConc":null,"assayConc":null}
  </code></pre>
  
  <p>My PHP file looks like so:</p>
  
  <pre><code>&lt;?php
  
  //Include connection to database
  require_once 'connect.php';
  
  $kinase = mysql_real_escape_string ($_POST["kinaseEntry"]);
  
  mysql_query('SET CHARACTER SET utf8'); 
  
  $findKinase = "SELECT * FROM kbaData where cleanSKU = '" .$kinase. "' ";
  
  if ($result = mysql_query($findKinase)) {
  
      $row = mysql_fetch_array($result, MYSQL_ASSOC);
  
      $kinaseSKU = $row['cleanSKU'];
      $url = $row['url'];
      $molecularWeight = $row['molecularWeight'];
      $tracerSKU = $row['tracerSKU'];
      $antiSKU1 = $row['antiSKU1'];
      $antiSKU2 = $row['antiSKU2'];
      $bufferSKU = $row['bufferSKU'];
      $tracerConc = $row['tracerConc'];
      $assayConc = $row['assayConc'];
  
  
      /* JSON ROW */
      $json = array ("kinaseSKU" =&gt; $kinaseSKU, "url" =&gt; $url, "molecularWeight" =&gt; $molecularWeight, "tracerSKU" =&gt; $tracerSKU, "antiSKU1" =&gt; $antiSKU1, "antiSKU2" =&gt; $antiSKU2, "bufferSKU" =&gt; $bufferSKU, "tracerConc" =&gt; $tracerConc, "assayConc" =&gt; $assayConc );
  
  } else  {
  
      /* CATCH ANY ERRORS */
      $json = array('error' =&gt; 'Mysql Query Error');
  }
  
  /* SEND AS JSON */
  header("Content-Type: application/json", true);
  
  /* RETURN JSON */
  echo json_encode($json);
  
  /* STOP SCRIPT */
  exit;
  ?&gt;
  </code></pre>
  
  <p>Am I going about this the wrong way? Or have I done this wrong?</p>
  
  <p>EDIT: Here is my jQuery/Ajax that calls the PHP script:</p>
  
  <pre><code>$(document).ready(function()    {
  
  $('#kinaseEntry').change(function ()    {
  
      var kinaseEntry = $('#kinaseEntry').val();
      var dataString = 'kinaseEntry' + kinaseEntry;
  
      $('#waiting').show(500);
      $('#message').hide(0);
      alert(kinaseEntry);
  
      //Fetch list from database
      $.ajax({
          type : "POST",
          url : "post.php",
          datatype: "json",
          data:   dataString,
          success : function(datas)   {
              alert("datas" + datas);
          },
          error : function(error) {
              alert("Oops, there was an error!");
          }
      });
      return false;
  });
  });
  </code></pre>