Skip to content
Snippets Groups Projects
Commit 3b0392aa authored by Audry Nyonata's avatar Audry Nyonata
Browse files

fix save button

parent c0adc501
No related merge requests found
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
$nomor = $_POST['nomor']; $nomor = $_POST['nomor'];
$confirm = $_POST['confirm']; $confirm = $_POST['confirm'];
$oldName = $_POST['oldName'.$nomor]; $oldName = $_POST['oldName'.$nomor];
if ($confirm == "yes") { if (isset($_POST['saveButton'])) {
if (isset($_POST['saveButton'])) { $newName = $_POST['newName'.$nomor];
$newName = $_POST['newName'.$nomor]; $sql = 'update location set name="'.$newName.'" where idUser='.$idUser.' AND name="'.$oldName.'";';
$sql = 'update location set name="'.$newName.'" where idUser='.$idUser.' AND name="'.$oldName.'";'; if ($conn->query($sql) === TRUE) {
if ($conn->query($sql) === TRUE) { $result = $conn->query($sql);
$result = $conn->query($sql); }
} } else if (isset($_POST['deleteButton'])) {
} else if (isset($_POST['deleteButton'])) { if ($confirm == "yes") {
$sql = 'delete from location where idUser='.$idUser.' AND name="'.$oldName.'";'; $sql = 'delete from location where idUser='.$idUser.' AND name="'.$oldName.'";';
if ($conn->query($sql) === TRUE) { if ($conn->query($sql) === TRUE) {
$result = $conn->query($sql); $result = $conn->query($sql);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment