This commit is contained in:
jakani24
2024-02-07 16:53:33 +01:00
parent 434c9dfe8b
commit bd99ac79f8
2 changed files with 3 additions and 3 deletions

View File

@@ -100,7 +100,7 @@
// Create settings table // Create settings table
$sql = "CREATE TABLE IF NOT EXISTS settings ( $sql = "CREATE TABLE IF NOT EXISTS settings (
id INT AUTO_INCREMENT PRIMARY KEY, id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL UNIQUE,
value VARCHAR(255) NOT NULL value VARCHAR(255) NOT NULL
)"; )";

View File

@@ -39,8 +39,8 @@ function safe_settings(){
$name=htmlspecialchars($_GET["update"]); $name=htmlspecialchars($_GET["update"]);
//update what should be done if a virus is found //update what should be done if a virus is found
if($_GET["update"]=="setting_virus_ctrl_virus_found_action"){ if($_GET["update"]=="setting_virus_ctrl_virus_found_action"){
//$stmt = $conn->prepare("INSERT INTO settings (name,value) VALUES (?,?) ON DUPLICATE KEY UPDATE value = ?;"); $stmt = $conn->prepare("INSERT INTO settings (name,value) VALUES (?,?) ON DUPLICATE KEY UPDATE value = ?;");
$stmt = $conn->prepare("UPDATE settings set value=? WHERE name='virus_ctrl:virus_found:action';"); //$stmt = $conn->prepare("UPDATE settings set value=? WHERE name='virus_ctrl:virus_found:action';");
$stmt->bind_param("s",$value); $stmt->bind_param("s",$value);
$stmt->execute(); $stmt->execute();
$stmt->close(); $stmt->close();