Below image shows a code snippet:
query="insert into mytable values ('%s','%s','%s','%s',%s,'%s')"
value=(str(cr),str(cs),str(srv),str(cl),recipe["total_time"],image,name)
print(name)
cursor.execute(query%value)
mydb.commit()
I have added a print(name) statement to show what exactly the "name" variable is. (its a string). On running, I get an error:
The "paneer ki sabji | .." is the value of name. I am inserting the data in "name" into the mysql table, under a column of type "nvarchar".
Is the error because of the special character "|"? If yes, how do we fix it, and why did the "nvarchar" not take care of it?