0
I’m having a problem with an update. of this mistake
string(42) " UPDATE files SET desc='ssss' WHERE id=131" Error updating record: You have an error in your SQL syntax; check the manual that Corresponds to your Mariadb server version for the right syntax to use near 'desc='ssss' WHERE id=131' at line 1
follows my code
<?php
// Include the database configuration file
require 'conn/conn1.php';
$id_img = $_POST['id'];
$desc = $_POST['desc'];
$sql = " UPDATE files SET desc='$desc' WHERE id=$id_img";
var_dump($sql);
if (mysqli_query($conn1, $sql)) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . mysqli_error($conn1);
}
mysqli_close($conn1);
?>
could you please help me!