On Sat, 17 Sep 2005, Ed Hotchkiss wrote:
Ok. I am trying to read a csv file with three strings separated by
commas. I am trying to insert them into a MySQL DB online. MySQLdb is
installed, no problems.
I think that I am having some kind of error with my csv going into the
fields and being
You should avoid sending the connection info to the list. Google will
be making this widely available. Pranksters *will* delete your tables.
Change your password!
Including the error info would help, but chances the following changes
will fix things:
stmt = CREATE TABLE links (
ID INT NOT
I dont see why your new code shouldn't work, it makes sense to me ...
Danny nailed this one. He warned that your data could be short commas.
You have lines with fewer than two commas. The INSERT is failing with:
not enough arguments
Simple fix is to skip insert if len(links) != 3.
On Sat, 17 Sep 2005, Ed Hotchkiss wrote:
I think that I am having some kind of error with my csv going into the
fields and being broken apart correctly.
Ed, I'd suggest using the CSV module to parse out CSV files, rather than
splitting it yourself.