I have a mySQL table with entries each having an input ID and input text; can somebody help me fix this PHP/AJAX code so that I can edit the input text of the entries.
PHP CODE:
$inputID = $_POST['inputID'];
$inputtxt = $_POST['inputtxt'];
$strSql = "UPDATE Contributions SET $inputID = '$inputID', $inputtxt='inputtxt' WHERE id = '$id'"
AJAX:
<script>
$( "#EDITsave" ).click(function() {
console.log("console")
var index = document.getElementById("editinputtext").value;
$.ajax({
type: "POST",
url: "edit.php",
data: {inputID: id, inputtxt:index},
dataType: "text",
success:function( msg ) {
alert( "Data Saved: " + msg );
}
});
});
</script>