You are here: Re: Importing csv file into mysql « All PHP « IT news, forums, messages
Re: Importing csv file into mysql

Posted by Tim Streater on 03/02/07 10:53

In article <1172832169.649337.178690@h3g2000cwc.googlegroups.com>,
"kenoli" <kenoli.p@gmail.com> wrote:

> I have tried two php scripts in an attempt to load data exported from
> an Exel file into a mysql database. One I found in the archive for
> this group and another elsehwere. Here are the scripts:

[snip]

> This one enters data, but incorrectly, as if there were the wrong
> number of fields in each record (i.e. data ends up in wrong fields),
> though I have checked carefully to make sure this is not the case.
>
> I'm not sure about the line terminations in the csv file. I tried
> using what is created by the Excel export. I also tried opening it
> and saving it in TextWrangler as I know it inserts proper linux line
> terminators. Same problem.

Why not do:

echo $sql . "\n";

to see what you are actually asking mysql to do.

-- tim

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация