phpmyadmin exporting to csv issue

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

phpmyadmin exporting to csv issue

Post by donny »

hello,

i have a database their all tinytext fields and the data in my database is all correct

however when i export to CSV it is stripping all the 0's if 0 is the beginning of a number for example 012345 is coming out as 12345 and i have a field that is like this JAN 09 in my db and the CSV makes it Jan-09 .. puts it into lowercase and replaces a space with a -

any body know why this is happening?

thank you
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: phpmyadmin exporting to csv issue

Post by Celauran »

You probably shouldn't have a field that contains 'JAN 09' in your database. Store dates as DATE or DATETIME and handle the formatting only when you're displaying the dates. Also, are you sure it's the export that's making those changes and not Excel? Have you tried viewing the exported CSV in a plain text editor?
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: phpmyadmin exporting to csv issue

Post by donny »

yes it was excel doing it. when i view it in plain text its the correct way. any idea?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: phpmyadmin exporting to csv issue

Post by Celauran »

If the CSV is OK, what's the problem?
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: phpmyadmin exporting to csv issue

Post by donny »

the CSV is fine when viewed in plain text. when brought into excel it changing those 2 things only
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: phpmyadmin exporting to csv issue

Post by Celauran »

That's an Excel issue, then. I'm no pro with Excel, but maybe check the formatting of the cells in question?
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: phpmyadmin exporting to csv issue

Post by donny »

if its an excel issue i will figure it out. thank you very much for your help
Post Reply