Help me with this code PLEASE
John Gordon
gordon at panix.com
Tue Nov 5 17:06:48 EST 2013
In <l5bnpc$71v$1 at dont-email.me> Nick the Gr33k <nikos.gr33k at gmail.com> writes:
> # fetch those columns that act as lists but are stored as strings
> cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE
> counterID = %s and host = %s''', (cID, host) )
> data = cur.fetchone()
> if cur.rowcount:
> # unpack data into variables
> (ref, visit, download) = data
>
> visit = visit.split()
>
> [Tue Nov 05 23:21:52 2013] [error] [client 176.92.96.218] visit =
> visit.split()
> [Tue Nov 05 23:21:52 2013] [error] [client 176.92.96.218]
> AttributeError: 'NoneType' object has no attribute 'split'
It appears that in the row you're fetching from the visitors table, the
'visits' column is NULL.
Your next step is track down why.
--
John Gordon Imagine what it must be like for a real medical doctor to
gordon at panix.com watch 'House', or a real serial killer to watch 'Dexter'.
More information about the Python-list
mailing list