Is there an exception
in my pymysql
insert statement below that I can use here to pass
on looping if the value already exists?
My code looks like:
try:
with db.cursor() as cursor:
sqltld = "INSERT INTO `table`(`colname`) VALUES (%s)"
cursor.execute(sqltld, (self.url))
db.commit()
except:
print("error INSERTing url")
db.rollback()
Mysql is already enforcing unique
on the column colname
Thanks