I have a char() column in a table to store zip codes. I noticed that if the zip code is '08062', MySQL will strip off the leading zero. Now if I add anything to the zip code that is not an integer, say a hyphen, or space MySQL will keep the leading zero.
I have thought of a work around, in that I can add a space to the end of any incoming value, then when I select the data out of the table MySQL will strip off any white space at the end because the column type is char(). I was just hoping that there was some way to really achieve what I want, and not resort to work arounds.
TIA,
Itshim
I have thought of a work around, in that I can add a space to the end of any incoming value, then when I select the data out of the table MySQL will strip off any white space at the end because the column type is char(). I was just hoping that there was some way to really achieve what I want, and not resort to work arounds.
TIA,
Itshim