Building a query programatically
It seems you want to keep you PHP code simple and make the SQL code more complicated, while it should be otherwise.

Example: lets say that
 - user A chooses: "color = 'red', size = 'Medium', category = any"
 - user B chooses "color = any, size = any, category = 'Tshirts'"

The conditions could be respectively as simple as:

-- userA
WHERE color = $color AND size = $size 
-- or the equivalent (if columns are NOT NULL):  
WHERE color = $color AND size = $size AND category = category


and for 

-- userB
WHERE category = $category
-- or the equivalent (if columns are NOT NULL):
WHERE color = color  AND size = size  AND category = $category


I don't think it's so difficult to write PHP code that produces those conditions when a user selects some "any", no matter how that "any" is coded in your PHP/web form.

But if you really want to pass that to MySQL, you can do something like this. Pass the "any" as a fixed value (say 'any') and use:

WHERE (color    = $color    OR $color    = 'any')
  AND (size     = $size     OR $size     = 'any')
  AND (category = $category OR $category = 'any')