EllisLab text mark
Advanced Search
     
upload excel
Posted: 03 July 2007 04:21 AM   [ Ignore ]
Avatar
Joined: 2007-05-21
17 posts

any ane can help me,
i need sample class to upload excel into mysql

 
Posted: 03 July 2007 01:25 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-06
743 posts

Excel could be saved as a CSV. If that works for you then you could use:

$fp fopen($complete_path_to_the_uploaded_csv_file"r")
while (($line fgetcsv($fp1000",")) !== false
{
   
// $line is an array of cells for the current line in the file
   
   // do something

There are other examples here:
http://ca3.php.net/fgetcsv

 Signature 

“I am the terror that flaps in the night”

 
Posted: 03 July 2007 02:42 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-13
70 posts

Are you sure you need to upload the excel file into the database (thats at least the way I read this post) or upload the file on the server and pass the database the name of the file and location for retrieval. The latter will be better all around.