finalize the edit function
the edit function can now update all the relevant fields
This commit is contained in:
parent
8e061ec901
commit
7380999487
|
@ -120,17 +120,19 @@ function pbget($con)
|
|||
// A function to edit a demand
|
||||
function editpost($con)
|
||||
{
|
||||
if (isset($_POST['submit'])) {
|
||||
if (isset($_POST['edit'])) {
|
||||
global $con;
|
||||
$userId = $_POST['userId'];
|
||||
$demandId = $_POST['demandId'];
|
||||
$piecesMax = $_POST['piecesMax'];
|
||||
$piecesMin = $_POST['piecesMin'];
|
||||
$date = $_POST['date'];
|
||||
$text = $_POST['text'];
|
||||
|
||||
// Inserts Updates Database
|
||||
$sql = "UPDATE demands SET message='$message' WHERE demandId='$demandId'";
|
||||
$sql = "UPDATE demands
|
||||
SET piecesMax='$piecesMax',
|
||||
piecesMin='$piecesMin',
|
||||
text='$text'
|
||||
WHERE demandId='$demandId'";
|
||||
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
|
||||
header("Location: board.php");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue