林试图更新queueStatusINT WHERE statusINT是8和queueStatusINT不等于2和类型为$类型。 不过,我不断收到错误:

ERROR 1064 (42000) at line 1: 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 ‘ queueStatusINT!='2’, type=’int'' at line 1

林使用该SQL查询来执行更新:

UPDATE $mysqlTable SET queueStatusINT='2’ WHERE statusINT='8’, queueStatusINT!='2’, type=‘$type’;

我也注意到,我可以在SELECT命令做一个不等于...

SELECT nameTXT FROM $mysqlTable WHERE queueStatusINT!='2' ORDER BY queueStatusINT DESC, priorityINT DESC, id ASC LIMIT 7;
有帮助吗?

解决方案

您需要使用与您的标准相结合,不只是逗号。

例如

UPDATE $mysqlTable 
SET    queueStatusINT = '2'
WHERE  statusINT      =  '8'
AND    queueStatusINT != '2'
AND    type           =  '$type'

其他提示

您更新更改为:

UPDATE $mysqlTable 
SET queueStatusINT='2’ 
WHERE statusINT=8
AND queueStatusINT !=2 
AND type=‘$type’;

我认为queueStatusINT是一个整数(顾名思义) - 你应该离开了',因为它们象征着一个字符串/字符

祝, 费边

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top