我正在尝试运行UPDATE
,但出现语法错误。我正在使用 php 和 PDO 来创建UPDATE
命令。我的语法有什么问题?
更新教育,其中 userId = :userId AND fieldId = :fieldId SET fieldId = :fieldId, educationTitle = :educationTitle,educationDegree = :educationDegree, startDate = :startDate, endDate = :endDate,educationDescription = :educationDescription;
错误:
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'WHERE userId = '35' AND fieldId = '4' SET fieldId = '4', educationTitle = 'ththt' 附近使用正确的语法
更新:
我试过像下面的示例一样放置WHERE
,SET
但我仍然遇到语法错误。
更新教育集 fieldId =:fieldId,educationTitle =:educationTitle,educationDegree =:educationDegree,startDate =:startDate,endDate =:endDate,educationDescription =:educationDescription,其中 userId =:userId AND fieldId =:fieldId;