Converting a string to a number by using INT (no hash method)

John Gordon gordon at panix.com
Tue Jan 22 15:40:39 EST 2013


In <mailman.829.1358882945.2939.python-list at python.org> Ferrous Cranus <nikos.gr33k at gmail.com> writes:

> May i sent you my code by mail so for you see whats wrong and
> http://superhost.gr produces error?

I tried going to that address and got some error output.  I noticed this
in the error dump:

     186         if cursor.rowcount == 0:
     187                 cursor.execute( '''INSERT INTO visitors(pin, host
   , hits, useros, browser, date) VALUES(%s, %s, %s, %s, %s)''', (pin, hos
   t, 1, useros, browser, date) )

The INSERT statement gives six column names but only five placeholders (%s)
in the VALUES clause.

Perhaps that's the problem?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list