MySQLdbd error. Perhpas it isn't installed?
nagia.retsina at gmail.com
nagia.retsina at gmail.com
Wed Mar 27 14:15:03 EDT 2013
Τη Τετάρτη, 27 Μαρτίου 2013 6:48:44 μ.μ. UTC+2, ο χρήστης MRAB έγραψε:
> On 27/03/2013 06:42, Νίκος Γκρ33κ wrote:
>
> > Τη Τετάρτη, 27 Μαρτίου 2013 6:26:06 π.μ. UTC+2, ο χρήστης ru... at yahoo.com έγραψε:
>
> >
>
> >> If not, maybe you can try adding a print statement to your code that
>
> >> will print the value of 'page'. This will be easier to do if you
>
> >> can run you code interactively. If you have to run it via a webserver
>
> >> than maybe you'll need wrap the print output in html commands to make
>
> >> it visible on the page, or to write it to a file.
>
> >
>
> >
>
> > I tried what you suggested by doign the following:
>
> >
>
> > print( page )
>
> > sys.exit(0)
>
> > cur.execute( '''SELECT hits FROM counters WHERE url = %s''', (page,) )
>
> >
>
> >
>
> > and the result is printed in the webpage as 'index.html'
>
> >
>
> > so page seem s to be a string but the error is still persistant.
>
> > Anything else i need to try?
>
> >
>
> A brief look at the documentation tells me that MySQL uses '?' as the
>
> placeholder instead of '%s':
>
>
>
> cur.execute('''SELECT hits FROM counters WHERE url = ?''', (page, ))
But as i have it used to work withour problem with pyhton 2.6
Why would it be a problem now?
More information about the Python-list
mailing list