Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$query = $query."AND `category` != '(1,2)') ORDER BY id DESC LIMIT $a , $b" ;
长话短说,找不到上述 (1,2) 的正确语法,我不想用另一个 AND 重写,因为将来可能会出现更多值。
希望有人可以帮助我;)。
您应该使用NOT IN运算符。
NOT IN
$query = $query."AND `category` NOT IN (1,2)) ORDER BY id DESC LIMIT $a , $b" ;