Space s are not different from any other character when it comes to strings and how databases store them. You don't need to to do anything special. if the spaces are being removed, then there is something in the code that doing it. You'll need to track down and find it.