I am trying to update only one column of MySQL table using the code below, but for some reason it always fails and gives me Invalid query error! What am I doing wrong here?
$query = "UPDATE dbTester SET username ='$MediaUserName' WHERE ID = '".$row['ID']."'";
$result2 = mysql_query( $con, $query );
echo $query;
if (!$result2) {
die('Invalid query: ' . mysql_error());
}
Error:
UPDATE dbTester SET username ='cindy' WHERE ID = '10796'Invalid query: