excell to mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandeepn
    New Member
    • Oct 2007
    • 1

    #1

    excell to mysql

    hi... i am doin a project .. i want to know how to import data to mysql database from excel sheet and vice versa using php coding......... please guide me through this...... thank u
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi. Welcome to The Scripts!

    What you need to do that is an Excel parser. A program to convert an Excel formated file into... whatever format you need it to be. XML I suppose.

    You will need to either write this yourself or find a pre-made program to do this for you. Google is a good place to start searching ;)

    If you choose to write it yourself, you will need to get to know the internals of an Excel formated file. That will be the biggest challenge.

    Comment

    • coolgames
      New Member
      • Oct 2007
      • 168

      #3
      found one..
      <Link Removed>

      costs a lot though...
      might want to look for some "Freeware" programs i reccomend..
      takes more time but, saves a lot of money.
      Last edited by Atli; Oct 5 '07, 08:11 PM. Reason: Removed link to a commercial web.

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, Sandeep. Welcome to TSDN!

        If it is practical to export your Excel file as a CSV, you can import the file using MySQL's built-in LOAD DATA INFILE command.

        Comment

        • Yardgnome
          New Member
          • Oct 2007
          • 6

          #5
          You can also use ODBC to read an Excel file and also to create a new Excel file.

          You can open the Excel file similar to how you would open a MySQL connection.
          [code=php]
          odbc_connect("D river={Microsof t Excel Driver(*.xls)}; Dbq=C:\filename .xls;");
          [/code]
          From there you would use the ODBC database commands to read or write to the Excel file.
          Last edited by pbmods; Oct 5 '07, 05:24 PM. Reason: Added CODE tags.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Heya, Yardgnome.

            Please use CODE tags when posting source code:

            &#91;CODE=ph p]
            PHP code goes here.
            &#91;/CODE]

            Comment

            Working...