connect_error) { echo '

Connection failed

'; die("Connection failed: " . $conn->connect_error); } // Insert new record into the database $sql = "INSERT INTO Info (Voltage) VALUES ('". $_GET["voltage"] ."')"; $result = $conn->query($sql); // To prevent overload on the database, delete records older than 31 days $sql = "DELETE FROM Info WHERE Time < DATE_SUB(NOW(), INTERVAL 31 DAY);"; $result = $conn->query($sql); $conn->close(); ?>