title: How to properly format PDO results? - numeric results returned as string?
body: <p>With relative newness to AJAX, and now just starting to learn PDO, the added level of ReSTler has me completely boggled.  Modeling the below code from Restler samples, I don't know how to change the output format from what PDO <em>is</em> returning to what Restler and Highcharts is expecting.  </p>
  
  <p>How do I change this code to get from the current format to the required format?  (The results will generally be 5K-10K records, if that's a factor in handling the MySQL result.)</p>
  
  <p><strong>ReSTler API Code Snippet</strong>:</p>
  
  <pre><code>$sql = "SELECT ....."
  $this-&gt;db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  try {
      $stmt = $this-&gt;db-&gt;query($sql);
      return $stmt-&gt;fetchAll();
  } catch (PDOException $e) {
      throw new RestException(502, 'Listing History: ' . $e-&gt;getMessage());
  }
  </code></pre>
  
  <p><strong>Current Output Format</strong> (includes <em>unwanted</em> column names):</p>
  
  <pre><code>[
    {
      "chart_date": "1118966400000",
      "bandwidth": "10.01",
      "views": "101"
    },
    {
      "chart_date": "1119225600000",
      "bandwidth": "20.02",
      "views": "101"
    },
  </code></pre>
  
  <p><strong>Desired Output Format</strong> (numeric and <em>without</em> column names):</p>
  
  <pre><code>[
    [
      1118966400000,
      10.01,
      101
    ],
    [
      1119225600000,
      20.02,
      202
    ],
  </code></pre>
  
  <p><strong>Edit using <em>suggested</em> <code>fetch(PDO::FETCH_NUM)</code>:</strong></p>
  
  <p>Per the answer from @Ricardo Lohmann, I tried fetch(PDO::FETCH_NUM), which DID remove the column names, but all columns returned seem to be string, not numeric, as the data actually is, so try this, giving me the right data type - is this part of PDO to unilaterally return string?</p>
  
  <pre><code>while ($row = $stmt-&gt;fetch(PDO::FETCH_NUM)) {
      $array[$x][0] = intval( $row[0] );
      $array[$x][1] = intval( $row[1] );
      $array[$x][2] = intval( $row[2] );
      $x++;
  }
  return $array;
  </code></pre>