Can't get php update to work for mysql
First, I am a beginner with php and mysql. I'm testing out a script to update the value in a column. This script keeps throwing the error "Query was empty". I'm trying to put the $activationNumber value into a column called activation1 for the row where the value in the serial column matches the $serialNumber value.
I double checked and there is a row in the table with the $serialNumber value in the serial column. There is also a column called activation1.
$serialNumber = 'TEST-1234-TEST-6789';
$activationNumber = 'TEST123';
$con = mysql_connect("localhost","unsername","password");
die('Could not connect: ' . mysql_error());
$query = "UPDATE my_table SET activation1 = '$activationNumber', WHERE serial = '$serialNumber'";
die('Error: ' . mysql_error());
echo "Activation Added to Database";