$DB_PORT="3314"; // OR 3314
$ID=$_POST["ID"];
$Nazov=$_POST["Nazov"];
//$ID=5;
//$Nazov="vino";
$conn = new mysqli($DB_ADDR,$DB_USER,$DB_PASS,$DB_NAME,$DB_PORT);
if($conn->connect_error){ //checks connection
echo "Zlyhanie DB pripojenia ERROR Database Connection Failed: " . $conn->connect_error, E_USER_ERROR; //reports a DB connection failure
exit();
} else {
$input=mysqli_query($conn, "UPDATE tblCisAlkohol SET Nazov='$Nazov' WHERE ID='$ID'");
}
mysqli_close($conn);
?>
$DB_PORT="3314"; // OR 3314
$Nazov=$_POST["Nazov"];
$conn = new mysqli($DB_ADDR,$DB_USER,$DB_PASS,$DB_NAME,$DB_PORT);
if($conn->connect_error){ //checks connection
echo "Zlyhanie DB pripojenia ERROR Database Connection Failed: " . $conn->connect_error, E_USER_ERROR; //reports a DB connection failure
} else {
$input=mysqli_query($conn, "INSERT INTO tblCisAlkohol (ID, Nazov) VALUES (NULL,'$Nazov')");
}
mysqli_close($conn);
?>
$ID=$_POST["ID"];
//$ID=24;
$conn = new mysqli($DB_ADDR,$DB_USER,$DB_PASS,$DB_NAME,$DB_PORT);
if($conn->connect_error){ //checks connection
echo "Zlyhanie DB pripojenia ERROR Database Connection Failed: " . $conn->connect_error, E_USER_ERROR; //reports a DB connection failure
exit();
} else {
$kontkod = mysqli_query($conn, "SELECT * FROM tblCisAlkohol WHERE ID='$ID'");
$kod = mysqli_num_rows($kontkod);
if ($kod > 0) {
$input=mysqli_query($conn, "DELETE FROM tblCisAlkohol WHERE ID='$ID'");
echo "Zaznam bol vymazany";
}
else {
echo "Chyba...zaznam sa nevymazal !";
}
}
mysqli_close($conn);
?>
Svadba2024.aia (26.4 KB)