Python Forum
Extracting data from mysql
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting data from mysql
#1
hi, I have three objects in my program. Two QlinEdit: tpn1; tpn2 and one Qpush Button how to set a value after typing in QlineEdit tpn2 and pressing QpushButton searched the database and the possible result introduced in Qline Edit tpn1 ??? I have such a code, it works correctly but I do not know how to set the search value in the database to incur from QlineEdit tpn2 ?? Can you help ????


class Ui_MainWindow(object):
 
    def LoadData(self):
        conn = pymysql.connect(host="106.90.5.2",user="admin",password="admin123",db="pyqt5")
        
        with conn:
            myCursor=conn.cursor()
            cur = conn.cursor()
            cur.execute("select* from data where name like \"fg\"") 

            for i in range(cur.rowcount):
                result=cur.fetchall()

                for row in result:
                    self.cursor=QTextCursor(self.artykul1.document())

                    self.cursor.insertText(str(row[1]+"\n"))
Reply
#2
I will be doing something very simular...are there no replies to the original messag?
Reply
#3
I have not received any answer, I am always looking for an answer to this problem. Did you find any information in this topic ??
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Extracting Data from a Command Subroutine gw1500se 0 1,088 Nov-11-2021, 08:02 PM
Last Post: gw1500se
  Display MySQL data in QLlineEdit text boxes JayCee 1 4,057 Mar-26-2020, 03:55 PM
Last Post: JayCee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020