yep. the idea of the backslash is to make mysql (or whatever db you're using) ignore any special meaning, os insert special chars (such as \n or \t)
so a "\"" will be understood by mysql as ", which will prevent injections.
for example, an SQL such as
(...) WHERE user="$user"
could be vulnerable to an injection like
(...) WHERE user="1" or "true"
and with such code you would be able to prevent this:
(...) WHERE user="1\" or \"true"
btw, yes, you should do with ANYTHING which will be input from the user, regardless of what kind of query you're running