Have you echoed the $query string? Did it look ok? Have you tried it out? This time I will answer as good as I can, but please try it yourself next time. I don't know how it is in all cases, but I can give you some information at least.
If the value is a string it will work. It does not matter if the column allows null or not since even an empty string is a string and have a value.
When it comes to other datatypes (int, double, boolean, date, time, timestamp and so on) I have no idea what will happen. The best thing is probably to just try it out, then you will know.