Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 5 years ago.
I'm novice here and I have my code, there is running good before I create my SQL query. I use sqlite3 as database.
that's my code :
code.py
print """<INPUT Value="Valider" Type="SUBMIT" >
<head>
<script type="text/javascript">
{
alert('thank you.');
}
</script>
</head>"""
print "</body>"
print "</html>"
conn = sqlite3.connect('database.sqlite')
conn.row_factory = sqlite3.Row
c = conn.cursor()
sql = "INSERT INTO info_calc (my_argv[2], my_argv[3], my_argv[4], sys.platform, getpass.getuser(), machine ) VALUES (%s, %s, %s, %s, %s, %s)
try:
c.execute(sql)
conn.commit()
except:
conn.rollback()
cursor.close()
when I execute my code, I have this error :
sql = "INSERT INTO info_calc (my_argv[2], my_argv[3], my_argv[4], sys.platform, getpass.getuser(), machine ) VALUES (%s, %s, %s, %s, %s, %s)
^
SyntaxError: EOL while scanning string literal