If you are using Mysql you can try the
LOAD DATA
syntax. Essentially you could upload the file using php and then generate a dynamic query which you can then pass to your mysql_query() function.
LOAD DATA INFILE '/path/to/uploaded/file.csv' INTO TABLE test FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx' ignore 0;
The cleanest i would recomend is the excel converted to csv, albeit people can share their experience with just plain excelan example in php would look like<?$file_handle = fopen("file.csv", "r");$x=0;$fieldsStr == "";while (!feof($file_handle) ) {$x+=1;$line_of_text = fgetcsv($file_handle, 1024);//no of columns$sz = sizeof($line_of_text);//the line of text is an array getting the size gives you the size of the array thus the no of columns you are dealing with// you can do the rest here}fclose($file_handle);?>that should sought you for csv,for actual excel you should consider
_______________________________________________________________
We must Keep on,
On Thu, Jul 12, 2012 at 12:24 PM, <rickinyua@gmail.com> wrote:@Joe The data
Sent from my BlackBerry®
-----Original Message-----
From: joe mwirigi <joemwirigi@gmail.com>
Sender: skunkworks-bounces@lists.my.co.ke
Date: Thu, 12 Jul 2012 12:14:29
To: Skunkworks Mailing List<skunkworks@lists.my.co.ke>
Reply-To: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
Subject: Re: [Skunkworks] php script for uploading an excel sheet to mysql db
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke