HELP importing excel into PHPmyAdmin (already searched)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkcrimson
Forum Newbie
Posts: 8
Joined: Sun Jun 26, 2005 11:07 pm

HELP importing excel into PHPmyAdmin (already searched)

Post by darkcrimson »

Hi guys,

First off, I will say that I already searched for over an hour on this subject and tried EVERYTHING I could think of to get this working, no luck.

I have several excel files that I need to import into a table. I use PHPMyAdmin.

I know the whole insert data from textfile deal and I know you must convert to a CSV but something is not working, no matter what I seem to do, I get the following error <b>"File could not be read /tmp/phpN2DCgh
"</b>

I thought maybe it was my file that wasn't working but then I inserted a record in the table and exported into CSV and still no luck, same error.

I think the problem has to do with the settings I am choosing under the insert data from text file thing.

Here is the test record I am trying to insert for reference: "3434","dfdf","45454","dffd","dfdf","dfdfdf","2005-01-12","dfdf","343434","34343434","3.33","2000-11-11","sdsdsd","sadsadsad","23334343434","0000-00-00","22","kalamazoo","notes","33"

And the field names I have are: address city zip twp mortgagor mortgagee date_recorded assignee price SEV rate redempt_date legal contact number newspaper_date issue county notes parcID

The settings I am choosing are:

Fields terminated by: ,
Fields enclosed by: "
Fields escaped by: \
Lines terminated by: \r\n
Column names: address city zip twp mortgagor mortgagee date_recorded assignee price SEV rate redempt_date legal contact number newspaper_date issue county notes parcID
LOAD method: ...DATA


Does anyone who has imported a CSV before know what I am doing wrong?

Thanks!
Edit/Delete Message
User avatar
AnarKy
Forum Contributor
Posts: 119
Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa

PHPMyAdmin

Post by AnarKy »

I do not use PHPMyAdmin....
But I think the issue could be the format of the
date/time fields.

I recently had this issue with XML messages inserting
into my DB from another system.

If you export the data (especially the dates) the format
the export is in, May not be the actual format of the
column in the DB.

Again, this is only a guess. :(
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Another thing to look for in a CSV are commas in the data. If an address has a comma that could throw things off. Same with names (Smith, Jr.). What I have done in the past is export my Excel data into a TAB delimited file, then FIND/REPLACE the tabs into a working SQL command, then run the SQL through the phpMyAdmin SQL text box. It is a more time consuming, but it may save you more time that trying to figure why phpMyAdmin won't import a native Excel file.

BTW, I never did get PMA to import an XLS.
Post Reply