Connecting Tech Pros Worldwide Help | Site Map

Importing data from Excel into PHP

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 9th, 2005, 08:25 PM
Michal Maciejczak
Guest
 
Posts: n/a
Default Importing data from Excel into PHP

Is it possible to import data from excel file into php and than put it in
mysql database?



  #2  
Old November 9th, 2005, 08:45 PM
charliefortune
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

my brother imports excel sheets straight into mysql - would that be of
use to you ?

  #3  
Old November 9th, 2005, 09:15 PM
Michal Maciejczak
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

I ment only data from excel sheets, from fields A1,A2,B1,B2 etc. then I
could sort this data out and put them nicely into mysgl database
[color=blue]
> my brother imports excel sheets straight into mysql - would that be of
> use to you ?
>[/color]


  #4  
Old November 9th, 2005, 09:35 PM
Justin Koivisto
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

Michal Maciejczak wrote:[color=blue]
> I ment only data from excel sheets, from fields A1,A2,B1,B2 etc. then I
> could sort this data out and put them nicely into mysgl database[/color]

sounds like a job for the COM functions:

http://us3.php.net/manual/en/ref.com.php

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
  #5  
Old November 10th, 2005, 02:25 AM
Frank [GOD]
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

Save the data you want imported as CSV... then use mysqlimport from the
command line or in your PHP code!!
Another problem solved by GOD...

Frank


Michal Maciejczak wrote:[color=blue]
> Is it possible to import data from excel file into php and than put it in
> mysql database?
>
>[/color]
  #6  
Old November 10th, 2005, 07:15 AM
G0ng
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

Frank [GOD] wrote:[color=blue]
> Save the data you want imported as CSV... then use mysqlimport from the
> command line or in your PHP code!!
> Another problem solved by GOD...
>
> Frank
>[/color]


I'm using this in my website with no problem. I think it's the best (or
only?) solution cause you can also manipulate the data....

e.g $fp is the csv file

$tmp=fgets($fp);
while(!feof($fp)) {
$tmp=fgets($fp);
$t=explode(";",$tmp);
$val=str_replace("\"","",$t);
$val=str_replace("\\","",$val);

insert into....
  #7  
Old November 10th, 2005, 09:05 PM
Geoff Muldoon
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

michal.maciejczak@tesco.net says...[color=blue]
> Is it possible to import data from excel file into php and than put it in
> mysql database?[/color]

Check out:
http://sourceforge.net/projects/phpexcelreader/
and
http://paggard.com/projects/xls.reader/

Geoff M
  #8  
Old November 11th, 2005, 07:55 AM
Michal Maciejczak
Guest
 
Posts: n/a
Default Re: Importing data from Excel into PHP

Thank you very much,
That's exacly what I've been looking for


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.