Re: [PHP] CSV importer tool
On Tue, Nov 27, 2012 at 4:11 PM, tamouse mailing lists wrote: > On Tue, Nov 27, 2012 at 4:09 PM, tamouse mailing lists > wrote: >> On Tue, Nov 27, 2012 at 2:56 PM, Leandro Dardini wrote: >>> Hello, >>> I am going to write a PHP page to allow the client to upload a CSV file and >>> assign each column to one or more fields of a mysql table. Quite simple, >>> but I feel like I am reinventing the wheel... is it possible there is no >>> library to do it, maybe using AJAX or similar cute techniques? >>> >>> Leandro >> >> This has been asked a few times, I wrote up a how-to and posted it on my >> wiki: >> >> http://wiki.tamaratemple.com/Technology/UsingUploadedTempFilesToPopulateATableInPHP >> >> It's such a few actual lines of code, I wonder if no one thinks it's >> such a big deal to just write it over and over again. Basically it's >> handled pretty much entirely in SQL rather than PHP. > > Ah, sorry, in the time i was writing this our net went down, then came > back up, and I saw your earlier replies. Although on third thought, the technique of storing the entire CSV uploaded in a temp table to let the user decide what to do with the actual data has some possible use... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV importer tool
On Tue, Nov 27, 2012 at 4:09 PM, tamouse mailing lists wrote: > On Tue, Nov 27, 2012 at 2:56 PM, Leandro Dardini wrote: >> Hello, >> I am going to write a PHP page to allow the client to upload a CSV file and >> assign each column to one or more fields of a mysql table. Quite simple, >> but I feel like I am reinventing the wheel... is it possible there is no >> library to do it, maybe using AJAX or similar cute techniques? >> >> Leandro > > This has been asked a few times, I wrote up a how-to and posted it on my wiki: > > http://wiki.tamaratemple.com/Technology/UsingUploadedTempFilesToPopulateATableInPHP > > It's such a few actual lines of code, I wonder if no one thinks it's > such a big deal to just write it over and over again. Basically it's > handled pretty much entirely in SQL rather than PHP. Ah, sorry, in the time i was writing this our net went down, then came back up, and I saw your earlier replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV importer tool
On Tue, Nov 27, 2012 at 2:56 PM, Leandro Dardini wrote: > Hello, > I am going to write a PHP page to allow the client to upload a CSV file and > assign each column to one or more fields of a mysql table. Quite simple, > but I feel like I am reinventing the wheel... is it possible there is no > library to do it, maybe using AJAX or similar cute techniques? > > Leandro This has been asked a few times, I wrote up a how-to and posted it on my wiki: http://wiki.tamaratemple.com/Technology/UsingUploadedTempFilesToPopulateATableInPHP It's such a few actual lines of code, I wonder if no one thinks it's such a big deal to just write it over and over again. Basically it's handled pretty much entirely in SQL rather than PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV importer tool
On Tue, 2012-11-27 at 23:03 +0100, Leandro Dardini wrote: > Thank you, but I was looking for a "cute" code... letting the user to swap > columns, ignore others, set the number of rows to initially jump, preview > data... > > Leandro > > 2012/11/27 Jim Lucas > > > php csv importer script It shouldn't be too hard to code that. Most examples I've seen pull in the first 1 or few records to aid the user as an example. Then they're given a list of the possible fields to match against one by one. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] CSV importer tool
Thank you, but I was looking for a "cute" code... letting the user to swap columns, ignore others, set the number of rows to initially jump, preview data... Leandro 2012/11/27 Jim Lucas > php csv importer script
Re: [PHP] CSV importer tool
On 11/27/2012 12:56 PM, Leandro Dardini wrote: Hello, I am going to write a PHP page to allow the client to upload a CSV file and assign each column to one or more fields of a mysql table. Quite simple, but I feel like I am reinventing the wheel... is it possible there is no library to do it, maybe using AJAX or similar cute techniques? Leandro google for: php csv importer script Reading the first result, it seems it is exactly what you are looking for. -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CSV importer tool
Hello, I am going to write a PHP page to allow the client to upload a CSV file and assign each column to one or more fields of a mysql table. Quite simple, but I feel like I am reinventing the wheel... is it possible there is no library to do it, maybe using AJAX or similar cute techniques? Leandro