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

From: Date: Wed, 08 Aug 2007 18:06:06 +0000
Subject: Re: Not quite OT but maybe close... Help with MySQL
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-260446@lists.php.net to get a copy of this message
On 8/8/07, Jason Pruim <japruim@raoset.com> wrote: > > On Aug 8, 2007, at 2:00 PM, Daniel Brown wrote: > > > On 8/8/07, Jason Pruim <japruim@raoset.com> 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@raoset.com > >> > >> > >> > > > > 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@raoset.com > > > 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/.

« previous php.general (#260446) next »