Initial commit

This commit is contained in:
ldy
2025-06-06 17:14:52 +08:00
parent 0465a9baef
commit f0aabfb5ac
91 changed files with 4466 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
include '../ConnectDB.php';
if(isset($_GET["name"])) {
$name = $_GET["name"];
// Delete from the inventory table
$sql_clear_inventory = "DELETE FROM inventory WHERE name='$name'";
$res_1 = mysqli_query($conn, $sql_clear_inventory);
if(!$res_1){
echo "<br><br><br><br><br><br><br><br>";
echo "Error deleting from inventory: " . mysqli_error($conn);
return;
}
// Drop the column from the buyer table
$sql_clear_buyer = "ALTER TABLE buyer DROP COLUMN `$name`";
$res_2 = mysqli_query($conn, $sql_clear_buyer);
if(!$res_2){
echo "<br><br><br><br><br><br><br><br>";
echo "Error dropping column from buyer table: " . mysqli_error($conn);
return;
}
// Drop the column from the seller table
$sql_clear_seller = "ALTER TABLE seller DROP COLUMN `$name`";
$res_3 = mysqli_query($conn, $sql_clear_seller);
if(!$res_3){
echo "<br><br><br><br><br><br><br><br>";
echo "Error dropping column from seller table: " . mysqli_error($conn);
return;
}
echo "<script type='text/javascript'>
alert('Successfully deleted!');
window.location.href = './edit.php';
</script>";
}
?>