+ Reply to Thread
Results 1 to 9 of 9

 

Thread: Excel to DB

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts


    I wondered if there was a way to export an Excel spreadsheet directly into a MySQL DB?

    I would rather export it automatically rather than update it manually via my CMS.

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Jan 2009
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post
    I'm pretty sure if you get the Excel spreadsheet and convert it to CSV format you can then import one of the csv columns into an SQL column within a table.

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    There are loads of ways of doing this. I havent ever done it myself but can remember researching for a project I have yet to start and it is possible.

    I just done a quick Google and there are a few pre-written php classes that you could use.

  5. #5
    accelerator's Avatar
    Online shopping rocks!

    Status
    Offline
    Join Date
    Nov 2004
    Location
    England
    Posts
    3,008
    Thanks
    54
    Thanked 180 Times in 161 Posts
    Quote Originally Posted by tomraffe View Post
    I wondered if there was a way to export an Excel spreadsheet directly into a MySQL DB?

    I would rather export it automatically rather than update it manually via my CMS.
    I know that MySQL management software navicat.com can import a .xls file into a MySQL database.

    However, where you meaning you wanted to do this totally automatically through .php code?

    Rgds

  6. #6
    RezaBadel's Avatar
    Registered User

    Status
    Offline
    Join Date
    May 2008
    Location
    Newcastle Upon Tyne
    Posts
    185
    Thanks
    0
    Thanked 19 Times in 18 Posts
    Hi tomraffe,

    buy.at have created a feed processing guide document, which can be found here:

    http://files.perfiliate.com/solution...GuideFeb09.pdf

    The example is for an XML feed, however can be easily used for a CSV/PSV/TSV Excel file format.

    Here are some examples of getting a CSV file and then using the mysql query Insert or Update to get the data into your database:

    PHP: fgetcsv - Manual
    PHP MySQL Insert Into

    If you need any help with this please contact myself Reza.Badel@platform-a.com or our Data Quality Manager Simon.Quick@platform-a.com.

    Enjoy your weekend

    Reza
    Solutions Engineer
    buy.at

  7. #7
    Registered User

    Status
    Offline
    Join Date
    Feb 2006
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks all, Navicat worked well.

  8. #8
    chrisbrocklesby's Avatar
    Registered User

    Status
    Offline
    Join Date
    Oct 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also I have used in the pass Excel to MySql converter programs I have found from google

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Before you start - backup your database in your Admin,Tools,Database Backup or from phpmyadmin.


    In phpmyadmin choose your table
    click BROWSE
    scroll to the bottom of the page and hit EXPORT
    choose CSV for MS Excel
    choose from Excel edition: Windows (if on a PC)
    click zipped
    click GO and save you file to your PC, then unzip and alter in Excel.

    When finished altering - Save as csv (comma delimited)

    IMPORT CSV
    To IMPORT your list of products (or whatever) in phpmyadmin



    Go to phpmyadmin and choose your products table
    click BROWSE
    click SQL tab

    Under the 'Run SQL query window' you will see a box marked

    Or Location of the textfile:
    Location of the textfile:


    Underneath you will see some text that says...
    "Insert data from a textfile into table"

    Click it, you will see this....

    Location of the textfile
    CHOOSE YOUR CSV FILE YOU SAVED FROM EXCEL AS COMMA DELIMITED

    Fields terminated by
    CHANGE THIS FIELD TERMINATOR TO A COMMA , HENCE THE CSV (Comma Delimited File)

    ...DATA LOCAL
    Keep this to DATA LOCAL

    SUBMIT

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel
    By Bod in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 27-04-05, 09:11 AM
  2. Excel Airways
    By KevinEdwards in forum DGM Affiliates
    Replies: 0
    Last Post: 26-01-05, 04:27 PM
  3. Excel help
    By Graham@Buyagift in forum Programming
    Replies: 2
    Last Post: 24-08-04, 04:36 PM
  4. Excel help
    By Wardy in forum Programming
    Replies: 2
    Last Post: 31-10-03, 01:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2