44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
$Feld1 = $Feld2 = $Feld3 = $Feld4 = $Feld5 = "";
|
|
if (isset($_POST['Feld1']))
|
|
{
|
|
$Feld1 = "Feld1 = \"" . addslashes($_POST['Feld1']) . "\",";
|
|
}
|
|
if (isset($_POST['Feld2']))
|
|
{
|
|
$Feld2 = "Feld2 = \"" . addslashes($_POST['Feld2']) . "\",";
|
|
}
|
|
if (isset($_POST['Feld3']))
|
|
{
|
|
$Feld3 = "Feld3 = \"" . addslashes($_POST['Feld3']) . "\",";
|
|
}
|
|
if (isset($_POST['Feld4']))
|
|
{
|
|
$Feld4 = "Feld4 = \"" . addslashes($_POST['Feld4']) . "\",";
|
|
}
|
|
if (isset($_POST['Feld5']))
|
|
{
|
|
$Feld5 = "Feld5 = \"" . addslashes($_POST['Feld5']) . "\",";
|
|
}
|
|
|
|
$sql = "UPDATE " . PREFIX . "_" . $t_pos . "_Pos SET
|
|
Position = \"" . $_POST["Position"] . "\",
|
|
Anzahl = \"" . $_POST["Anzahl"] . "\",
|
|
Bezeichnung = \"" . $_POST["Bezeichnung"] . "\",
|
|
" . $Feld1 . "
|
|
" . $Feld2 . "
|
|
" . $Feld3 . "
|
|
" . $Feld4 . "
|
|
" . $Feld5 . "
|
|
Preis = \"" . $_POST["Preis"] . "\"
|
|
WHERE ID = \"" . $_POST["POS_ID"] . "\";";
|
|
$stmt = $db->prepare($sql);
|
|
if (!$stmt)
|
|
{
|
|
die ('Datensatz konnte nicht gespeichert werden: ' . $db->error);
|
|
}
|
|
if (!$stmt->execute())
|
|
{
|
|
die ('Datensatz konnte nicht gespeichert werden: ' . $stmt->error);
|
|
} |