Ivan Schrecklich
Ivan Schrecklich

Reputation: 499

MYSQL Selection more than one value

$query = $query."AND `category` != '(1,2)') ORDER BY id DESC LIMIT $a , $b" ;

Long story short, can't find the right syntax for the above (1,2) and i don't want to write over with another AND because there may apear more values in future.

Hope somebody can help me ;).

Upvotes: 1

Views: 101

Answers (1)

Skpd
Skpd

Reputation: 670

You should use NOT IN operator.

$query = $query."AND `category` NOT IN (1,2)) ORDER BY id DESC LIMIT $a , $b" ;

Upvotes: 2

Related Questions