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" ;