yes I will post..import mysql.connector
class MyDB:
global cursor
def __init__(self, hs, us, pw, db):
conn = mysql.connector.connect(host = hs, user=us, passwd = pw, database = db)
#global cursor
cursor = conn.cursor();
cursor.execute("show TABLES")
print(cursor.fetchall())
db2 = MyDB("localhost","root","","mydbsnh")
class MyDB:
global cursor
def __init__(self, hs, us, pw, db):
conn = mysql.connector.connect(host = hs, user=us, passwd = pw, database = db)
#global cursor
cursor = conn.cursor();
cursor.execute("show TABLES")
print(cursor.fetchall())
db2 = MyDB("localhost","root","","mydbsnh")