B
baur79
Hi guys
i try to run this code in loop and to pass even the entry is
duplicated
def email_insert_in_db(email):
sql="INSERT INTO emails (email) values ('%s') "%(email)
db=_mysql.connect(host = "localhost", user = db_user, passwd =
db_pass, db = db_name)
try:
db.query(sql)
except IndentationError:
print "duplicate"
pass
also try to (raise, continue)
but can't continue in loop
error output is:
File "inser_in_db.py", line 85, in email_insert_in_db
db.query(sql)
IntegrityError: (1062, "Duplicate entry '(e-mail address removed)' for key 1")
thanks for your help
Baurzhan Zhakashev
Kazakhstan / Shymkent city
i try to run this code in loop and to pass even the entry is
duplicated
def email_insert_in_db(email):
sql="INSERT INTO emails (email) values ('%s') "%(email)
db=_mysql.connect(host = "localhost", user = db_user, passwd =
db_pass, db = db_name)
try:
db.query(sql)
except IndentationError:
print "duplicate"
pass
also try to (raise, continue)
but can't continue in loop
error output is:
File "inser_in_db.py", line 85, in email_insert_in_db
db.query(sql)
IntegrityError: (1062, "Duplicate entry '(e-mail address removed)' for key 1")
thanks for your help
Baurzhan Zhakashev
Kazakhstan / Shymkent city