Don't think this would work......
For instance, if $value1 was empty, but $value2 wasn't, my query would look like this:
select * from yourtable where AND somethingelse='$value2'
i've currently got a way working, but i'd rather not post it here (not that i'm embarrased, but the whole process involves much more information than i've given). If anyone's really psyched to see what i've done, let me know, and i'll post it (and a 10 page long explanation :-))
-Phil