So is this :
cursor.execute("Insert INTO visit (pid, date, diagnosisid) VALUES (%s,%s,%s)",
(pid, date, diagnosisid))
enough or do I need :
cursor.execute("Insert INTO visit (pid, date, diagnosisid) VALUES (%s,%s,%s)",
(escape_string(pid), escape_string(date), escape_string(diagnosisid)))
?
The first one is enough; the second one would double your efforts, replacing e.g.
"with\". You can test it yourself withSo you see that the 2nd version would produce an unneeded
\before the". So the first one is ok.