converting Excel to MySQL using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sathishkumar2011
    New Member
    • Jan 2007
    • 2

    converting Excel to MySQL using PHP

    How we wil convert from ms-Excel sheet to MySQL database using PHP
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Simplest way is to export data from excel as TXT or CSV. Than use MySQL command
    Code:
    LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table;
    When the Excel file is XML, you can write a xml parser program that parses the xml and saves the results in your MySQL db. For free XML parsing classes see XML classes at phpclasses.org.

    When you are looking for a conversion program, there are a lot of them around (try googling for excel to mysql), but they all charge some dollars for usage (starting at USD 25).

    Ronald :cool:

    Comment

    • limweizhong
      New Member
      • Dec 2006
      • 62

      #3
      Originally posted by ronverdonk
      Simplest way is to export data from excel as TXT or CSV. Than use MySQL command
      Code:
      LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table;
      When the Excel file is XML, you can write a xml parser program that parses the xml and saves the results in your MySQL db. For free XML parsing classes see XML classes at phpclasses.org.

      When you are looking for a conversion program, there are a lot of them around (try googling for excel to mysql), but they all charge some dollars for usage (starting at USD 25).

      Ronald :cool:
      Is there any way of converting .xls files into mysql only using PHP? (then can get users to upload their excel files and automatically converting them)

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Have a look at this class ADODB XML and see if it fulfills your need. See the last paragraph in the quote.
        Originally posted by ADODB Class
        This class is meant to import and export data stored in SQL databases to XML files using the ADODB library.

        It provides a function to export the data of SQL query result set to XML file.

        It also provides another function that parses XML files that define the data of fields to be inserted as new rows of a table also specified in the XML files.
        Ronald :cool:

        Comment

        Working...