Connecting Tech Pros Worldwide Forums | Help | Site Map

Importing data from Excel into PHP

Michal Maciejczak
Guest
 
Posts: n/a
#1: Nov 9 '05
Is it possible to import data from excel file into php and than put it in
mysql database?



charliefortune
Guest
 
Posts: n/a
#2: Nov 9 '05

re: Importing data from Excel into PHP


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

Michal Maciejczak
Guest
 
Posts: n/a
#3: Nov 9 '05

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]


Justin Koivisto
Guest
 
Posts: n/a
#4: Nov 9 '05

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
Frank [GOD]
Guest
 
Posts: n/a
#5: Nov 10 '05

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]
G0ng
Guest
 
Posts: n/a
#6: Nov 10 '05

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....
Geoff Muldoon
Guest
 
Posts: n/a
#7: Nov 10 '05

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
Michal Maciejczak
Guest
 
Posts: n/a
#8: Nov 11 '05

re: Importing data from Excel into PHP


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


Closed Thread