Connecting Tech Pros Worldwide Help | Site Map

Importing data from Excel into PHP

  #1  
Old November 9th, 2005, 09:25 PM
Michal Maciejczak
Guest
 
Posts: n/a
Is it possible to import data from excel file into php and than put it in
mysql database?


  #2  
Old November 9th, 2005, 09:45 PM
charliefortune
Guest
 
Posts: n/a

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, 10:15 PM
Michal Maciejczak
Guest
 
Posts: n/a

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, 10:35 PM
Justin Koivisto
Guest
 
Posts: n/a

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, 03:25 AM
Frank [GOD]
Guest
 
Posts: n/a

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, 08:15 AM
G0ng
Guest
 
Posts: n/a

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, 10:05 PM
Geoff Muldoon
Guest
 
Posts: n/a

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, 08:55 AM
Michal Maciejczak
Guest
 
Posts: n/a

re: Importing data from Excel into PHP


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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
import data from excel file [mydata.xls] into mysql table arshigill answers 1 April 4th, 2008 02:44 PM
Code for Importing data from tables into MS- Excel zubairnawazawan answers 1 November 28th, 2007 12:52 PM
Importing CSV data to MSSQL using PHP Julius Mong answers 0 July 20th, 2005 06:21 AM
Handling .xls files with PHP - can it be done? Joshua Beall answers 9 July 17th, 2005 07:53 AM