Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Wrong syntax (1 reply)

$
0
0
When I run the following code I get an error that "You have an error in your SQL Syntax". Here is my code, what is wrong with it?:


# import MySQL module
import MySQLdb

# connect
db = MySQLdb.connect(host="localhost", user="xxxx", passwd="xxxxxxx",
db="XXXXXXX")

# create a cursor
cursor = db.cursor()

# execute SQL statement
cursor.execute("""INSERT INTO sample table (abc_dx) VALUES ("A simple test")""")

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>