Reputation: 177
I need to store phone numbers starting with 0 but whenever i try to store this in MySql table the starting ZERO is removed because no number start with Zero actually how i can solve this problem please do i need to change the field type from Integer to another type
Upvotes: 2
Views: 831
Reputation: 172578
Try to change the datatype to unsigned-zerofill
. Refer the manual.
or you can use the LPAD function as well like
SELECT LPAD( yourNumber, lengthOfYourNumber, '0')
Upvotes: 1