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

Ferrous Cranus nikos.gr33k at gmail.com
Wed Jan 23 03:44:47 EST 2013


Τη Τρίτη, 22 Ιανουαρίου 2013 10:40:39 μ.μ. UTC+2, ο χρήστης John Gordon έγραψε:
> 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?

Excatly Gordon, i missed the extra placeholder(%s) when i was adding a new useros column. I also used a 5-digit number.

Now my website finally works as intended. Just visit the following links plz.
------------------------------------------------------------------------------
1. http://superhost.gr

2. http://superhost.gr/?show=log

3. http://i.imgur.com/3Hcz1uP.png  (this displays the database's column 'pin', a 5-digit number acting as a filepath indicator. I guess i won't be needing column 'page' anymore)

4. http://i.imgur.com/kRwzLp3.png   (this is the detailed page information associated to 'pin' column indicator instead of something like '/home/nikos/public_html/index.html'

Isn't it a nice solution?




More information about the Python-list mailing list