I'l looking for how to save contenteditable to my sql DB.
I have something like this:
echo '<td contenteditable="true" onblur="saveToDatabase" id="regist" style="background-color:'.$row['regist_color'].'" >'.$row['regist'].'</td>'
I don't know ho to send this information to this url with onblur="function"
:
<?php
include 'db.php';
$id=$_POST['id'];
$sql = "UPDATE minichat SET
regist='".$_POST['regist']."' WHERE id=".$_POST['id'];
if (mysqli_query($conn, $sql)) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . mysqli_error($conn);
}
('location:index.php');
mysqli_close($conn);
?>