www.webdeveloper.com
Results 1 to 3 of 3

Thread: Guys need help???

  1. #1
    Join Date
    Dec 2010
    Location
    Nepal
    Posts
    3

    Guys need help???

    i need to read the content from the excel file. Ok , i solved this problem. Now the problem here is to insert it into the database .Can someone help me...

  2. #2
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101

    Excel and DB

    Is your question related in how to bring Excel data within a DB?..
    Excel files are perfectly suitable for databases; if you use Access you simply have to import your Excel file. Take a look to the Excel file structure first, sometimes it's suggested to optimize it in order to allow a correct import operation.
    But maybe you're asking for something more sophisticated...
    Last edited by MrSnowDrop; 04-05-2011 at 05:14 AM.

  3. #3
    Join Date
    Jul 2007
    Location
    Wisconsin
    Posts
    468
    If you are reading the excel file line-by-line, assuming it's comma-separated, you can explode the row into an array, and generate your mysql_query() from that.

    PHP Code:
    $buffer fgets($zoneFileHandle4096);
    $fileLineArray explode(","$buffer); // choose your line delimiter here; comma, tab, special characters, what-have-you

    $tmpSqlLine "INSERT INTO " $table " (COL1, COL2, COL3...) VALUES ('" $fileLineArray[0] . "', '" $fileLineArray[1] . "', '" $fileLineArray[2] . "' ...)"

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles