you wouldn't put -1 in the URL variable.
what this is doing is:
if the URL is:
the where clause becomes:
categories.CategoryLink = -1 OR -1 = -1
so: OR -1 = -1 evaluates to true
but if you pass a value for the category:
then the comparison is:
categories.CategoryLink = Occasional-Chairs OR -1 = Occasional-Chairs
hopefully that clarifies.