Skip to content Skip to sidebar Skip to footer

Incorrect Integer Value Error

I am trying to enter some values from some lists I have into a table in MySQL in Python. I have written the following: CREATE TABLE IF NOT EXISTS friend_attributes ( Friend int

Solution 1:

You have to escape single quote characters or the query gets mixed up about what is a string and what is not.

This won't work :

Select * from test where name = 'O'Connor' 

But this will work :

Select * from test where name = 'O\'Connor'

Have a look at mysqli.real-escape-string which will do the job for you.


Post a Comment for "Incorrect Integer Value Error"