Escaping confusion with Python 3 + MySQL

Νίκος Βέργος me.on.nzt at gmail.com
Sun Mar 26 10:41:07 EDT 2017


I see thank you for pointing that out.

Now i'm receiving no error in error_log but when i'm running the script

it displays this:

ProgrammingError(1064, "You have an error in your SQL syntax; check the
manual that corresponds to your MariaDB server version for the right syntax
to use near '(pagesID, host, ref, location, useros, browser, visits) VALUES
(1, 'cyta.gr', '' at line 1")

How to test this further?

Στις Κυρ, 26 Μαρ 2017 στις 5:38 μ.μ., ο/η INADA Naoki <
songofacandy at gmail.com> έγραψε:

> I used space only for readability.  It's not required.
>
> >>> '%%%s%%' % (42,)
> '%42%'
>
> On Sun, Mar 26, 2017 at 11:35 PM, Νίκος Βέργος <me.on.nzt at gmail.com>
> wrote:
> > i have tried that 2 days ago.
> >
> > Problem is that you maintained space before and after '%s'  which wont
> work
> > within like
> >
> > How would you type it without space as in "%%s%" ?
> >
> > Στις Κυρ, 26 Μαρ 2017 στις 5:32 μ.μ., ο/η INADA Naoki
> > <songofacandy at gmail.com> έγραψε:
> >>
> >> > I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character.
> >> >
> >>
> >> >>> '%% %s %%s' % (42,)
> >> '% 42 %s'
> >>
> >> Use %%
> >
> > --
> > What is now proved was at first only imagined!
>
-- 
What is now proved was at first only imagined!


More information about the Python-list mailing list