0byt3m1n1
Path:
C:
/
wamp64
/
www
/
WaterCat
/
[
Home
]
File: del.php
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "watercat"; $did = $_POST['detailsid']; $inid = $_POST['infoid']; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if (isset($_POST['delete'])) { $deleteDetailsQuery = "DELETE FROM details WHERE Details_id = '$did'"; $resultDetails = $conn->query($deleteDetailsQuery); if ($resultDetails) { $deleteInfoQuery = "DELETE FROM info WHERE info_id = '$inid'"; $resultInfo = $conn->query($deleteInfoQuery); if ($resultInfo) { echo "<script> alert('Data Deleted SUCCESSFULLY!!!'); window.location.href = 'list.php'; </script>"; } else { echo "<script> alert('Error!!! Failed to delete data from info table'); window.location.href = 'indexNew.php'; </script>"; } } else { echo "<script> alert('Error!!! Failed to delete data from details table'); window.location.href = 'indexNew.php'; </script>"; } } $conn->close(); ?>