SHARE
TWEET

Untitled

a guest Feb 18th, 2015 181 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $servername = "localhost";
  3. $username = "username";
  4. $password = "password";
  5. $dbname = "myDB";
  6.  
  7. $now = new DateTime();
  8. parse_str( html_entity_decode( $_SERVER['QUERY_STRING']) , $out);
  9.  
  10. if ( array_key_exists( 'heap' , $out ) ) {
  11.   // Create connection
  12. $conn = new mysqli($servername, $username, $password, $dbname);
  13. // Check connection
  14. if ($conn->connect_error) {
  15.     die("Connection failed: " . $conn->connect_error);
  16. }
  17.  
  18. $sql = "INSERT INTO HeapTable ( datelog , heapvalue)
  19. VALUES ($now->format('Y-m-d H:i:s'), $out['heap'])";
  20.  
  21. if ($conn->query($sql) === TRUE) {
  22.     echo "New record created successfully";
  23. } else {
  24.     echo "Error: " . $sql . "<br>" . $conn->error;
  25. }
  26.  
  27. $conn->close();
  28. ?>
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