Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
# MySQL.py
import MySQLdb
class MySQL:
def __init__(self,host,user,password,database):
self.host = host
self.user = user
self.password = password
self.database = database
self.success = False
try:
self.connection = MySQLdb.connect(host=self.host,user=self.user,passwd=self.password,db=self.database)
self.cursor = self.connection.cursor()
except:
pass
else:
self.success = True
def execute(self,qstring):
if self.success != True:
return False
try:
self.cursor.execute(qstring)
except:
return False
else:
self.data = self.cursor.fetchall()
self.fields = self.cursor.description
self.cursor.close()
self.connection.close()
return True
def getFields(self):
return self.fields
def getData(self):
return self.data