每当我尝试使用mysqli_stmt_bind_param在SET操作中将变量用作列名时,它似乎都失败了。我做错了什么还是我误解了什么?
$connection = mysqli_connect('localhost', 'username', '******', 'db');
$query = "UPDATE stock SET ? = '4' WHERE storeID = 1";
$stmt = mysqli_prepare($connection, $query);
mysqli_stmt_bind_param($stmt, "s", $shirtSize);
$shirtSize = "whiteSmall";
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
mysqli_close($connection);