Hello everyone the problem I am having is that I am unable to update a mysql row with php that is determined by a string. The code that does not work is below
mysqli_query($con1,"UPDATE Complete SET $GameName = '5'
WHERE Username='$UserInfo[0]'");
But this code works see how the row I want to set changes
mysqli_query($con1,"UPDATE Complete SET rowname = '5'
WHERE Username='$UserInfo[0]'");
I have already tried to put single quotes around $Gamename to no avail. and cant place the row name in quotes for unknown reasons. UPDATE: I have tried to get an error log but the debugger is not recognizing any problems so to try and help I will post another example that does not work but will help to determine that $UserInfo[0] is not the problem.
mysqli_query($con1,"UPDATE Complete SET $GameName = '5'
WHERE Username='beta'");
Also To rule out things like the variable $GameName
from being the problem I tested the code below to no avail.
$Column="Addition";
mysqli_query($con1,"UPDATE Complete SET $Column= '5'
WHERE Username='beta'");
But the code below this does work
mysqli_query($con1,"UPDATE Complete SET Addition= '5'
WHERE Username='beta'");