synonim pages and new dump
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
include('../include/headscript.php');
|
||||
include("../class/company.php");
|
||||
$conn = new mysqli($servername, $username, $password, $database);
|
||||
if (isset($_POST['id'], $_POST['field'], $_POST['value'])) {
|
||||
$id = $_POST['id'];
|
||||
$field = $_POST['field'];
|
||||
$value = $_POST['value'];
|
||||
|
||||
// Assicurati di proteggere da SQL injection usando prepared statements
|
||||
$stmt = $conn->prepare("UPDATE analysisvocabulary SET $field = ? WHERE idanalysisvocabulary = ?");
|
||||
$stmt->bind_param('si', $value, $id);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
echo json_encode(['success' => true]);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'error' => $stmt->error]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'error' => 'Invalid input']);
|
||||
}
|
||||
Reference in New Issue
Block a user