Jump to content

How could i re-write the WHERE clause in this query?


laanes

Recommended Posts

Hi, i've got a question in my head:

 

How could i improve the WHERE clause in this query? :

 

$query = "SELECT cat_name FROM " . $table . " WHERE cat_id != 300 AND cat_id != 200 AND cat_id != 100";

 

It works, but i can imagine when there will be more excluded categories, there will be a lot of AND's.

 

Any way to make this query more decent?

 

Kind regards,

laanes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.