daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Sep 21st, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  2. <script type="text/javascript">
  3. google.charts.load('current', {'packages':['line']});
  4. google.charts.setOnLoadCallback(drawChart);
  5.  
  6. function drawChart() {
  7.  
  8.   var data = new google.visualization.DataTable();
  9.   data.addColumn('timeofday', 'Time');
  10.   data.addColumn('number', 'SO2');
  11.   data.addColumn('number', 'O2');
  12.   data.addColumn('number', 'VOC');
  13.  
  14.   data.addRows([
  15. <?php
  16. $servername = "localhost";
  17. $username = "root";
  18. $password = "shhhhhhhhhhhhhh";
  19. $dbname = "enb355";
  20.  
  21. // Create connection
  22. $conn = new mysqli($servername, $username, $password, $dbname);
  23. // Check connection
  24. if ($conn->connect_error) {
  25.   die("Connection failed: " . $conn->connect_error);
  26. }
  27.  
  28. $sql = "SELECT * FROM aqs";
  29. $result = $conn->query($sql);
  30.  
  31. if ($result->num_rows > 0) {
  32.   // output data of each row
  33.   while($row = $result->fetch_assoc()) {
  34.     //Echo the format here.
  35.   }
  36. } else {
  37.   echo "0 results";
  38. }
  39.  
  40. $conn->close();
  41. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top