def __init__(self): self.connect = DBHelper().connectDatabase() # 连接数据库 self.connect = pymysql.connect(host=self.host, db=self.db, user=self.user, passwd=self.passwd, charset='utf8', port=self.port, use_unicode=False) # 通过cursor执行增删查改 self.cursor = self.connect.cursor()
def __init__(self): self.connect = DBHelper().connectDatabase() # 连接数据库 self.connect = pymysql.connect(host=self.host, port=self.port, user=self.user, password=self.passwd, db=self.db) # 通过cursor执行增删查改 self.cursor = self.connect.cursor()
def __init__(self): self.connect = DBHelper().connectDatabase() # 连接数据库 self.connect = MySQLdb.connect(host=self.host, port=self.port, user=self.user, passwd=self.passwd, db=self.db, charset='utf8') # 通过cursor执行增删查改 self.cursor = self.connect.cursor()
def get_bbs_topic_id(self): sql = 'SELECT bbs_id,topic_id FROM auto_home_club_topic_list' topic_id_list = DBHelper().query(sql) return topic_id_list
def __init__(self): self.db_helper = DBHelper()
def get_bbs_topic_id(self): sql = 'SELECT bbs_id,topic_id FROM auto_home_club_topic_list WHERE post_topic_date > "2018-01-01" ORDER BY topic_id ' topic_id_list = DBHelper().query(sql) return topic_id_list
def __init__(self): self.connect = DBHelper().connectDatabase() # 通过cursor执行增删查改 self.cursor = self.connect.cursor()