title: mySQL to PHP to jQuery returning floating point value as string (JSON)
body: <p>I am new to PHP, jQuery and SQL, and I am trying to return data from my database to be used in my javascript file.  For some reason, my object is being returned as a string even though values should be floating point numbers.</p>
  
  <p>My database structure has this column setup to be a floating point number.</p>
  
  <p>Here is a segment of my PHP code:</p>
  
  <pre><code>$q = "SELECT object FROM $tableName";
  
  if($q === FALSE) { 
      die(mysql_error());
  }
  
  $sth = mysqli_query ($con, $q);
  $rows = array();
  while($r = mysqli_fetch_assoc($sth)) {
      $rows[] = $r;
      }
  
  print json_encode($rows);
  </code></pre>
  
  <p>and here is my javascript:</p>
  
  <pre><code>$.get('PHP file URL', function(data) {
  
      var object = JSON.parse(data);
  </code></pre>
  
  <p>However, I am getting the following (a string) returned instead of a floating point number:</p>
  
  <pre><code>[{"object":"34.416"},{"object":"34.589"},{"object":"33.3948"}]
  </code></pre>
  
  <p>I can't seem to find this same issue already posted.  Please let me know what I am doing wrong.  Thanks!</p>