hi everyone,
i have wrote the database code like this
try:
import MySQLdb
import _mysql_exceptions as DB_EXC
cxn = MySQLdb.connect(host='10.0.2.2')
if(cxn != 0):
tkMessageBox.showinfo("Text", "you can update ur local database to server")
else:
tkMessageBox.showinfo("Text", "there is no connection please try again")
cxn.close()
except ImportError , e:
return None
when there is connectivity then the control is going to the IF block. but when the connectivity loss the control is not going to the else block. is there any wrong in my syntax.
pls give a quick and valuable reply.