Re: Not quite OT but maybe close... Help with MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/8/07, Jason Pruim <japruim@xxxxxxxxxx> wrote:
>
> On Aug 8, 2007, at 2:00 PM, Daniel Brown wrote:
>
> > On 8/8/07, Jason Pruim <japruim@xxxxxxxxxx> wrote:
> >> Hey everyone,
> >>
> >> I tried asking this question on the MySQL list but haven't gotten
> >> very many helpful responses... Does anyone know how to successfully
> >> import a excel file into MySQL (To make it on topic) Using PHP? I
> >> have tried using LOAD FILE in mysql and it just imports the first row
> >> of my excel file with no errors...
> >>
> >> Any ideas?
> >> --
> >>
> >> Jason Pruim
> >> Raoset Inc.
> >> Technology Manager
> >> MQC Specialist
> >> 3251 132nd ave
> >> Holland, MI, 49424
> >> www.raoset.com
> >> japruim@xxxxxxxxxx
> >>
> >>
> >>
> >
> >     It is a MySQL question, you're right.... but are you trying to
> > load a CSV that you read in Excel, or is it in Excel format?
>
> Currently, the file is an Excel file, but I can export to csv, tab,
> txt, or what ever else excel can go to... So quite a qide array of
> options...
>
>
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
> > Hey, PHP-General list....
> > 50% off for life on web hosting plans $10/mo. or more at
> > http://www.pilotpig.net/.
> > Use the coupon code phpgeneralaug07
> > Register domains for about $0.01 more than what it costs me at
> > http://domains.pilotpig.net/.
> >
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 3251 132nd ave
> Holland, MI, 49424
> www.raoset.com
> japruim@xxxxxxxxxx
>
>
>

    Wait for someone else to confirm this before taking it as gospel,
but I'm pretty sure that, unless you're using Navicat (or another
third-party application, or perhaps even a PCRE module I'm not aware
of), you have to dump it to a plain-text format to parse it.

    So you could dump the Excel data to a CSV and read it in as a
file, line-by-line, field-by-field, or you could look into the `LOAD
DATA INFILE` and `LOAD DATA LOCAL INFILE` MySQL query strings to see
which one will work on your system.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Hey, PHP-General list....
50% off for life on web hosting plans $10/mo. or more at
http://www.pilotpig.net/.
Use the coupon code phpgeneralaug07
Register domains for about $0.01 more than what it costs me at
http://domains.pilotpig.net/.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux