parsing CSV, updating MySQL table
| From: | Justin French | Date: | Sat, 18 May 2002 08:41:39 +0000 |
| Subject: | parsing CSV, updating MySQL table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98236@lists.php.net to get a copy of this message | ||
Hi,
I have a client with an Excel file of products / prices / etc. For
arguments sake, let's keep it simple:
id,title,description
if they were to export this as a CSV, then it could be used to update a
mysql table (for existing ID's), and to insert any new ID's.
So, I guess what I'm after is a group of functions which parse a CSV file,
and update a MySQL table to match... rather than messing around in a web
based GUI, the client could just upload a new CSV every couple of days.
I've checked out fgetcsv() etc, and I *think* i've got a picture of how the
code would look, but before I start, I figure a set of functions probably
already exists out there to do this... so why reinvent the wheel????
If anyone can point me to a URL, class, function, article, etc, I'd be
pretty happy :)
Justin French