From 31082e1342ed1c47a5825e67b5d87606a1468e65 Mon Sep 17 00:00:00 2001 From: alfianina Date: Tue, 16 Jul 2024 12:33:47 +0700 Subject: [PATCH] Upload files to "/" --- update.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 update.php diff --git a/update.php b/update.php new file mode 100644 index 0000000..a7f7ee3 --- /dev/null +++ b/update.php @@ -0,0 +1,41 @@ +connect_error) { + die("Koneksi database gagal: " . $conn->connect_error); + } + + // Mengupdate data ke dalam tabel (gantilah dengan struktur tabel Anda) + $sql = "UPDATE isi_data SET ultrasonic=$ultrasonic, infrared=$infrared, valve=$valve, suhu=$suhu WHERE id=1"; + + if ($conn->query($sql) === TRUE) { + echo "Data berhasil diupdate"; + } else { + echo "Error: " . $sql . "
" . $conn->error; + } + + // Menutup koneksi + $conn->close(); + +} else { + echo "Parameter tidak lengkap"; +} + +?>