Inserting Excel data into MYSQL

Discussion in 'PHP' started by LaPoChE, Aug 3, 2006.

  1. #1
    Hey I need help :)

    i'm still pretty new to PHP. I need to take the data stored into a excel spreadsheet and insert it to a mysql database. Can anyone help me with this?

    Thanks
     
    LaPoChE, Aug 3, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Install phpmyadmin it does all this stuff for you.
     
    mad4, Aug 3, 2006 IP
  3. LaPoChE

    LaPoChE Active Member

    Messages:
    198
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    thank for the info, I will look into it.


    but i'd rather be able to code it into my site.
     
    LaPoChE, Aug 3, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Believe me, if you use php/mysql you need phpmyadmin. The stuff it does would be very hard to progam into your own site without loads of bugs.
     
    mad4, Aug 3, 2006 IP
  5. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can export the data from excel into CSV format. Then you can use phpMyAdmin to import it to the database. Or you can use the SQL command
    LOAD DATA INFILE. You can get more info on it here:
    http://dev.mysql.com/doc/refman/5.0/en/load-data.html

    Its syntax is somewhat like this:
    LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata;
    or
    LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata ( id,fname,lname,email);

    Thomas
     
    coderlinks, Aug 3, 2006 IP
  6. LaPoChE

    LaPoChE Active Member

    Messages:
    198
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #6
    thanks for the help.
     
    LaPoChE, Aug 3, 2006 IP