GUI_MySQL_class.py 文件源码

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

项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码
def updateGOF(self):
        # connect to MySQL
        conn, cursor = self.connect()   

        self.useGuiDB(cursor)      

        # execute command
        cursor.execute("SELECT Book_ID FROM books WHERE Book_Title = 'Design Patterns'")
        primKey = cursor.fetchall()[0][0]
        print("Primary key=" + str(primKey))

        cursor.execute("SELECT * FROM quotations WHERE Books_Book_ID = (%s)", (primKey,))
        print(cursor.fetchall())

        # close cursor and connection
        self.close(cursor, conn) 

    #------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号