title: JQuery ajax request - echo will not output result
body: <p>I've never encountered anything this strange before. I raise an Ajax request using jQuery to get a value from mysql.</p>
  
  <pre><code>$.ajax({
      url: 'ajaxClassificationCheck.php?category='+category,
      cache: false,
      success: function(returnClass)
      {
          $("#classification").val(returnClass);
  }});
  </code></pre>
  
  <p>and the php...</p>
  
  <pre><code>include_once ('functions.php');
  connectdb();
  
  $category = $_GET['category'];
  
  $q = "SELECT classification_id FROM sch_category WHERE category_id = $category";
  
  $r = mysql_query($q) or die (mysql_error());
  $row = mysql_fetch_assoc($r);
  $classification = $row['classification_id'];
  echo $classification;
  </code></pre>
  
  <p>The result in network capture shows the output from the ajax request which is empty.</p>
  
  <p>If I change:</p>
  
  <pre><code>echo $classification;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>echo "result is $classification";
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>result is 2
  </code></pre>
  
  <p>It also works with:</p>
  
  <pre><code>echo "a".$classification;
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>a2
  </code></pre>
  
  <p>Is there a minimum character limit on what can be returned via Ajax?</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Thanks for all your suggestions </p>
  
  <p>@RocketHazmat - tried dataType: 'text', still not returning single integer. Definitely using echo $classification; </p>
  
  <p>@dualed - I put the url into the browser window and I get the correct integer response so it is something wrong with my ajax.</p>
  
  <p>Any other ideas?</p>