title: How to pass MySQL query data to JavaScript variable?
body: <p>Here am getting data from mysql..</p>
  
  <pre><code>if (!empty($result1)) {
      while ($row1 = mysqli_fetch_array($result1)) {
          $caseno = $row1['cases'];
          echo "&lt;b&gt;" . $caseno . "&lt;br&gt;";
      }
  }
  </code></pre>
  
  <p>and i want pass the data which is there in <code>$caseno</code> to my below JavaScript..</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var gaugevalue = document.getElementById("$caseno");
      var myConfig2 = {
          "type": "gauge",
          "scale-r": {
              "aperture": 200, //Scale Range
              "values": "0:50:10" //and minimum, maximum, and step scale values.
          },
          "series": [{"values": [gaugevalue]}]
              //"series":[{"values":[40]}]
  
      };
  
      zingchart.render({
          id: 'myChart',
          data: myConfig2,
          height: "90%",
          width: "90%"
      });
  
  &lt;/script&gt;
  </code></pre>