fix the delete function
This commit is contained in:
parent
390482daea
commit
1c5f7d42c1
|
@ -206,9 +206,17 @@ function delete_demand()
|
|||
/* assign the variable with data from the delete button */
|
||||
$demandId = $_POST['demandId'];
|
||||
|
||||
/* Delete all the offers corresponding to the demandId
|
||||
from the database */
|
||||
$delete_offers_query = "DELETE FROM offers WHERE demandId='$demandId'";
|
||||
$delete_offers_result = mysqli_query($con, $delete_offers_query)
|
||||
or die(mysqli_error($con));
|
||||
|
||||
// Delete the demand matching the demandId from the database
|
||||
$sql = "DELETE FROM demands WHERE demandId='$demandId'";
|
||||
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
|
||||
$delete_demand_query = "DELETE FROM demands WHERE demandId='$demandId'";
|
||||
$delete_demand_result = mysqli_query($con, $delete_demand_query)
|
||||
or die(mysqli_error($con));
|
||||
|
||||
header('Location: board.php');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue