Hi I have got a column in my database which is set to Int.
But my data always starts with a 0 so whenever I add a new record, it strips the 0 off and I don’t want it to do that incase the first character has to be a 1 at some point.
How can I overcome this issue?
Is the best way to use VARCHAR any then validate using PHP?
Update
If I enter 02118272 it is saved to the database as 2118272.
I think that you should use varchar type for that field. If you want to convert a variable to integer in php you can simply do this:
with this you delete all characters that aren’t numbers and then you can put this value into the db preserving the initial 0.