Thanks for the answers. As you might have noticed I'm a newbie and didn't realise that GET needs a connection.
However, in my original code I'm having the same issue. The DB is updated with nothing or an empty string. At least it is connected.
<?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "dbname"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //$id = strip_tags(mysql_real_escape_string($_GET['id'])); $score = strip_tags(mysql_real_escape_string($_GET['score'])); $sql = "UPDATE users SET score_03='$score' WHERE id=2"; if ($conn->query($sql) === TRUE) { echo "Record updated successfully"; } else { echo "Error updating record: " . $conn->error; } $conn->close(); ?>
I will take your suggestions in consideration and step back to learn more about PDO or mysqli.
Thanks a lot.