Пример #1
0
    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()
Пример #2
0
    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()
Пример #3
0
    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()
Пример #4
0
Файл: club.py Проект: CY113/Cars
 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
Пример #5
0
Файл: club.py Проект: CY113/Cars
 def __init__(self):
     self.db_helper = DBHelper()
Пример #6
0
Файл: club.py Проект: CY113/Cars
 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
Пример #7
0
 def __init__(self):
     self.connect = DBHelper().connectDatabase()
     # 通过cursor执行增删查改
     self.cursor = self.connect.cursor()