Php 第1列后出现MySQL更新语法错误

Php 第1列后出现MySQL更新语法错误,php,mysql,sql,Php,Mysql,Sql,以下是查询: UPDATE clubs WHERE clubId = $clubId SET (name='$name', category = '$category', 'description' = '$description', president = '$president', email = '$email', phone = $phone', treasurer = $treasurer', treasurerEmail = $treasurerEmail',treasurerPho

以下是查询:

UPDATE clubs WHERE clubId = $clubId SET (name='$name', category = '$category', 'description' = '$description', president = '$president', email = '$email', phone = $phone', treasurer = $treasurer', treasurerEmail = $treasurerEmail',treasurerPhone = $treasurerPhone', advisor = '$advisor', advisorEmail = '$advisorEmail', projectCode = '$projectCode', rollover = $rollover)"
当我尝试运行它时,会出现以下错误: 更新club时出错。“}您的SQL语法有错误;请查看与您的MySQL服务器版本对应的手册,以了解在第1行的“WHERE clubId=1 SET(name='Radio',category='Media',desci'附近使用的正确语法


有什么想法吗?

你需要把
放在语句末尾的
位置

UPDATE clubs SET name='$name', category = '$category', 'description' = '$description', president = '$president', email = '$email', phone = $phone', treasurer = $treasurer', treasurerEmail = $treasurerEmail',treasurerPhone = $treasurerPhone', advisor = '$advisor', advisorEmail = '$advisorEmail', projectCode = '$projectCode', rollover = $rollover WHERE clubId = $clubId 
使用这个:

UPDATE clubs SET name = '$name', category = '$category', description = '$description', president = '$president', email = '$email', phone = '$phone', treasurer = '$treasurer', treasurerEmail = '$treasurerEmail', treasurerPhone = '$treasurerPhone', advisor = '$advisor', advisorEmail = '$advisorEmail', projectCode = '$projectCode', rollover = '$rollover' WHERE clubId = '$clubId'
你还有一堆不合适的

编辑sql只是为了泡面

UPDATE clubs SET
name = '$name',
category = '$category',
description = '$description',
president = '$president',
email = '$email',
phone = '$phone',
treasurer = '$treasurer',
treasurerEmail = '$treasurerEmail',
treasurerPhone = '$treasurerPhone',
advisor = '$advisor',
advisorEmail = '$advisorEmail',
projectCode = '$projectCode',
rollover = '$rollover'
WHERE clubId = '$clubId'

WHERE子句位于设置值列表之后(您不需要在设置的列名/值周围加括号),SQL不需要,但它应该在设置之前加上WHERE。意外地忽略WHERE子句会造成破坏,但如果它只是返回语法错误,则不会。为什么不换行以提高可读性?