I've written the following code and can't figure out why it doesn't work. In my php-error_log there is no error.
Im trying to change a row in a with ajax get. My variables are both defined and the Mysql-Connection works. So what am I doing wrong?
Javascript:
$.get("rename_task.php", {content: userinput, id: this_task});
PHP:
<?php
$db_connect = mysqli_connect('localhost', 'helreak', 'Password', 'helreak_todo');
$task_content = $_GET['content'];
$task_id = $_GET['id'];
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL:" . mysqli_connect_error();
}
mysqli_query($db_connect,"UPDATE list_1 SET Content=$task_content WHERE State=1 AND ID=$task_id");
mysqli_close($db_connect);
?>
Thanks, Luca