我对Python缺乏经验。
所以我的代码可以将数据插入到我的SQL表中,但我无法弄清楚为什么它们在进入表时会在名称周围加上引号。
What my table looks like in SQL after using my code to insert Matt Brown
这是我的代码
FirstName = formData["firstName"].value
LastName = formData["lastName"].value
print ("Content-type: text/html\n")
print()
# Some SQL to insert student
query ="INSERT INTO Students (LastName, FirstName) VALUES (%s, %s);"
print(query)
dbConnect.cur.execute(query, (LastName, FirstName))
dbConnect.conn.commit()