Mysqli更新无法正常工作

$conn = mysqli_connect($servername, $username, $password, $dbname);

if (!$conn) {

    die("Connection failed: " . mysqli_connect_error());
}

$sql = "UPDATE Cube SET xValue=15 WHERE Index=1";

mysqli_query($conn, $sql);

mysqli_close($conn);

This seems like it should be pretty straight forward, but for some reason, the xValue field won't change, and I get no errors whatsoever. Been trying this for too long.

as u_mulder said, index is a reserved word in mySQL so you got 2 options:

$sql = "UPDATE Cube SET xValue=15 WHERE Cube.Index=1";

or

$sql = "UPDATE Cube SET xValue=15 WHERE `Index`=1";