Exemplo n.º 1
0
 def fetchalll(self, query):
     try:
         self.__cursor.execute(query)
         res = self.__cursor.fetchall()
         return res
     except mysql.connector.Error as e:
         View.errors(e)
Exemplo n.º 2
0
 def __init__(self):
     try:
         self.__con = mysql.connector.connect(
         host="localhost",
         user="******",
         password="",
         database="management"
         )
         self.__cursor = self.__con.cursor()
         
     except mysql.connector.Error as e:
         View.errors(e)
Exemplo n.º 3
0
 def inputDB(self, sql, val):
     try:
         self.__cursor.execute(sql, val)
         self.__con.commit()
     except mysql.connector.Error as e:
         View.errors(e)