0

What ways can I use variables in Mysql Update SET? I'm trying to pass variables but I don't know if that's really how it's done and if it's safe;

How am I doing:

$update = $this->pdo->prepare(
  "UPDATE `user_info`
  SET '$name' = ? //This way
  WHERE unique_token = ?"
);

$update->execute(array($value, $unique_token));
Barmar
  • 741,623
  • 53
  • 500
  • 612

0 Answers0