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
|
// A function to edit a demand
|
||||||
function editpost($con)
|
function editpost($con)
|
||||||
{
|
{
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['edit'])) {
|
||||||
global $con;
|
global $con;
|
||||||
$userId = $_POST['userId'];
|
|
||||||
$demandId = $_POST['demandId'];
|
$demandId = $_POST['demandId'];
|
||||||
$piecesMax = $_POST['piecesMax'];
|
$piecesMax = $_POST['piecesMax'];
|
||||||
$piecesMin = $_POST['piecesMin'];
|
$piecesMin = $_POST['piecesMin'];
|
||||||
$date = $_POST['date'];
|
|
||||||
$text = $_POST['text'];
|
$text = $_POST['text'];
|
||||||
|
|
||||||
// Inserts Updates Database
|
// 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));
|
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
|
||||||
header("Location: board.php");
|
header("Location: board.php");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue