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...
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.
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.
$buffer = fgets($zoneFileHandle, 4096);
$fileLineArray = explode(",", $buffer); // choose your line delimiter here; comma, tab, special characters, what-have-you
$tmpSqlLine = "INSERT INTO " . $table . " (COL1, COL2, COL3...) VALUES ('" . $fileLineArray . "', '" . $fileLineArray . "', '" . $fileLineArray . "' ...)";
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)