Log in

View Full Version : .csv format



ganu
04-21-2009, 07:12 AM
hai,

i am downloading data from mysql database to .csv format.the data is correctly downloading,but if any field starting with zero(0),then zero is missing

eg: phone number:012345778987//which is stored in db.
but in .csv file the phone number is storing like this 12345778987//means zero is missing
what is reason thanks to you.

forum_amnesiac
04-21-2009, 08:39 AM
This always happens if you are dealing with numeric fields, any leading zeroes will be lost. To the system a numeric of 01 is exactly the same as 1 in value.

To keep leading zeroes you need to store things like telephone numbers as strings, if necessary you will need to validate that they only contain numeric values.