title: Google Chart API doesn't work with PHP?
body: <p>The Google API Chart doesn't take in the value I echo using php can anyone enlighten me to what I'm doing wrong?</p>
  
  <p>This is where the user picks the job chart they want to view:</p>
  
  <pre><code>&lt;form class="form-horizontal form-select-chart" method="post" action="analytics.php"&gt;
                  &lt;select name="chartname"&gt;
                  &lt;?php
                      $sel_user = "select * from tbl_jobs";
                      $run_user = mysqli_query($con, $sel_user);
                      while($row = mysqli_fetch_assoc($run_user))
                        {
                            echo "&lt;option value=\"" . $row['Job_ID'] . "\"&gt;" . $row['Job_Name'] . "&lt;/option&gt;";
                        }
                  ?&gt;
                  &lt;/select&gt;
                  &lt;br&gt;
                  &lt;input type="submit" name="make_chart" value="Create the Chart" class="btn btn-primary" /&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p>Here is where the data should be processed:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  &lt;?php
      if(isset($_POST['make_chart'])){
          $jid = mysqli_real_escape_string($con,$_POST['chartname']);
          $sel_user = "select * from tbl_jobs WHERE `ID` = '$jid'";
                      $run_user = mysqli_query($con, $sel_user);
                      while($row = mysqli_fetch_assoc($run_user))
                        {
                          $jname = $row['Job_Name'];
                          $overall_vacant = $row['Vacant'];   
                          $overall_filled = $row['Filled'];   
                        }
                        settype($overall_vacant, "integer");
                        settype($overall_filled, "integer");
      }
  ?&gt;
    // Load the Visualization API and the corechart package.
    google.charts.load('current', {'packages':['corechart']});
  
    // Set a callback to run when the Google Visualization API is loaded.
    google.charts.setOnLoadCallback(drawChart);
  
    // Callback that creates and populates a data table,
    // instantiates the pie chart, passes in the data and
    // draws it.
    function drawChart() {
      // Create the data table.
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Topping');
      data.addColumn('number', 'Slices');
      data.addRows([
        ['Vacant Positions', &lt;?php  echo $overall_vacant; ?&gt;],
        ['Filled Positions', &lt;?php  echo $overall_filled; ?&gt;],
      ]);
  
      // Set chart options
      var options = {'title':'&lt;?php echo $jname; ?&gt;',
                     'width':400,
                     'height':300};
  
      // Instantiate and draw our chart, passing in some options.
      var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is where the data to be displayed:</p>
  
  <pre><code>    &lt;?php 
          if(isset($_POST['make_chart'])){
          echo"&lt;div align=\"center\" id=\"chart_div\"&gt;&lt;/div&gt;"; 
          }
  
          unset($_POST['make_chart']));
      ?&gt;
  </code></pre>