sqlhandler.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:lightbulb-framework 作者: lightbulb-framework 项目源码 文件源码
def query_database(self, query):
        """
        Perform a database query
        Args:
            query (str): The SQL query
        Returns:
            list: Mysql Rows
        """
        try:
            self.cursor.execute(query)
            return self.cursor.fetchall()
        except MySQLdb.Error as err:
            # print("Failed executing query: {}".format(err))
            return 0
        except MySQLdb.Warning as wrn:
            return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号