Merhaba, oyunumda kullanmak için bir restapi yapmaya çalışıyorum.
Update yapmak için array kullanmayı denedim fakat hata alıyorum. hatanın nedenini çözemedim.
      foreach ($changes as $column => $value)
      {
          $setSql[] = "{$column} = :{$value}";
      }
      
      $sql ='UPDATE '.$table.' SET '. implode(",",$setSql) . '  WHERE userId ='.$userId.'';  
      $res =$this->conn->prepare($sql);      
      $res->execute();

Fatal error:  Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':JvQXAYHgerfPL3j5ZO1sNxBFDGbI,teamName = :sads,season = :0,score = :0,level = :0' at line 1 in C:\inetpub\wwwroot\RestApi\models\Update.php:48