Results 1 to 2 of 2

Thread: .csv format

  1. #1
    Join Date
    Apr 2009
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default .csv format

    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.

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •