title: Pie CHart keeps saying my first column isn't a string (Edit)
body: <p>Let me give a brief background: The process goes like this: DB Method returns a value to a side script -> generates JSON -> send to google chart js file. This will produce a Pie chart chart, but it keeps saying first column should be a string... which it is!. The codes:</p>
  
  <p>The PHP Class Method:</p>
  
  <pre><code>function select_heuristic_piechart1(&amp;$conn){
  
          $query = ("SELECT hl_name AS name, count(hl_element2) As counted FROM `heuristic_listings` group by hl_element1");
          $statement = $conn-&gt;prepare($query);
          $statement-&gt;execute();
          $exist = $statement-&gt;fetchAll(PDO::FETCH_ASSOC);
  
          $rows = array();
          $table = array();
  
          $table['cols'] = array(
  
          // Labels for your chart, these represent the column titles.
  
              array('label' =&gt; 'first_header', 'type' =&gt; 'string'),
              array('label' =&gt; 'second_header', 'type' =&gt; 'number')
  
          );
  
          foreach($exist as $r) {
  
            $temp = array();
  
            // the following line will be used to slice the Pie chart
  
            $temp[] = array('v' =&gt; (string) $r['name']); 
  
            // Values of each slice
  
           $temp[] = array('v' =&gt; (int) $r['counted']); 
           $rows[] = array('c' =&gt; $temp);
          }
  
          $table['rows'] = $rows;
  
  
          return $json = Json_encode($table,true);
  </code></pre>
  
  <p>The Receiver and Transmitter</p>
  
  <pre><code>include './database.php';
  
  
  $connection = new database();
  $conn = $connection-&gt;connect_db();
  $fetchedResult = $connection-&gt;select_heuristic_piechart1($conn);
  header('Content-Type: application/json');
  $json = json_encode($fetchedResult,true);
  
  echo $json;
  </code></pre>
  
  <p>And the Ajax: </p>
  
  <pre><code>$.ajax({
    url: "./db/receiver_and_transmitter.php",
    data: 'GET',
    dataType: 'json',
    success: function(data){
          console.log('Yas');
          console.log(data);
          var data = new google.visualization.DataTable(data);
  
      },
    error:function(data){
  
        console.log('fail');
        console.log(data);
    } 
  });
  </code></pre>
  
  <p>I have no idea what wen't wrong and what to change. Can someone point me in the right direction?</p>
  
  <hr>
  
  <p>The JSON that was received by the $.ajax:</p>
  
  <pre><code>{"cols":[{"label":"first_header","type":"string"}, 
  {"label":"second_header","type":"number"}],"rows":[{"c":[{"v":"cwood1r"},
  {"v":5}]},{"c":[{"v":"sward2h"},{"v":2}]},{"c":[{"v":"etorres19"},{"v":2}]},
  {"c":[{"v":"mfranklinr"},{"v":3}]},{"c":[{"v":"mspencerd"},{"v":21}]},{"c":
  [{"v":"jknight1y"},{"v":5}]},{"c":[{"v":"hhoward3"},{"v":4}]},{"c":
  [{"v":"pross6"},{"v":8}]},{"c":[{"v":"swagner7"},{"v":23}]},{"c":
  [{"v":"ajohnston1a"},{"v":8}]},{"c":[{"v":"dalexander1q"},{"v":2}]},{"c":
  [{"v":"rmendoza1u"},{"v":2}]},{"c":[{"v":"mmurphy1f"},{"v":5}]},{"c":
  [{"v":"rthomasp"},{"v":8}]},{"c":[{"v":"wsullivan5q"},{"v":1}]},{"c":
  [{"v":"bperkins3f"},{"v":3}]},{"c":[{"v":"csimpson1j"},{"v":4}]},{"c":
  [{"v":"mortiz2e"},{"v":10}]},{"c":[{"v":"sriley1h"},{"v":2}]},{"c":
  [{"v":"tbryantf"},{"v":10}]},{"c":[{"v":"esimmons15"},{"v":5}]},{"c":
  [{"v":"psullivan35"},{"v":2}]},{"c":[{"v":"jwatson9"},{"v":7}]},{"c":
  [{"v":"jcampbell1v"},{"v":2}]},{"c":[{"v":"rford14"},{"v":5}]},{"c":
  [{"v":"jnichols4m"},{"v":1}]},{"c":[{"v":"agreenm"},{"v":1}]},{"c":
  [{"v":"rmorris1"},{"v":4}]},{"c":[{"v":"pboyd16"},{"v":1}]},{"c":
  [{"v":"jdixon2"},{"v":12}]},{"c":[{"v":"kbrownv"},{"v":8}]},{"c":
  [{"v":"slarson2l"},{"v":2}]},{"c":[{"v":"lrileyn"},{"v":9}]},{"c":
  [{"v":"mholmes1t"},{"v":5}]},{"c":[{"v":"phill4"},{"v":5}]},{"c":
  [{"v":"pwalkerh"},{"v":2}]},{"c":[{"v":"thawkins1g"},{"v":6}]},{"c":
  [{"v":"crussell0"},{"v":27}]},{"c":[{"v":"cweaver3s"},{"v":2}]},{"c":
  [{"v":"fgonzalesb"},{"v":8}]},{"c":[{"v":"elopez10"},{"v":3}]},{"c":
  [{"v":"pnichols4f"},{"v":1}]},{"c":[{"v":"swallace1i"},{"v":4}]}]}
  </code></pre>