Show SQL Query Result Using wxPython
<p>I am trying to get the result from the SQL Query to show up next to the text "Tickets Closed Last 24 Hours" when the script is executed.<br>
The SQL Query returns a single number. 
I am trying to get the number to show in the StaticText box for self.some_text where it changes the label text to the number when ran. </p>

<p>Example: <a href="https://s11.postimg.org/jil0kzfqb/tickets.png" rel="nofollow noreferrer">https://s11.postimg.org/jil0kzfqb/tickets.png</a>
In the image there is no number from the SQL query.
(You can ignore the Address, unit number and city text and boxes)</p>

<p>I am going off another program someone else created so some of this code may not be needed.
I am trying to learn SQL and Python on the fly, pretty much a novice right now.</p>

<p>This is my code so far: </p>

<pre><code>import wx
import MySQLdb

db = MySQLdb.connect(host="xxxxxxxxxxxx",port=xxx,user="xx",passwd="xxxxx",db="xxxx")

class Data():
    def TicketsClosedLast24Hours(self, event):
        cur = db.cursor()
        cur.execute("Select COUNT(*) FROM HD_TICKET WHERE HD_STATUS_ID = 12 AND TIME_CLOSED &gt;= NOW() - INTERVAL 1 DAY")
        row = cur.fetchone()
        print(row[0])
        row = cur.fetchone()

class MainFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None)

        self.Centre()
        self.Maximize(True)

        self.background = wx.Panel(self)
        self.background.SetBackgroundColour(wx.Colour(98, 125, 152))

        self.some_text = wx.StaticText(self.background, wx.ID_ANY, label="", style=wx.ALIGN_CENTER)
        self.Address = wx.TextCtrl(self.background, -1, "", size=(140, -1))
        self.UnitNumber = wx.TextCtrl(self.background, -1, "", size=(140, -1))
        self.City = wx.TextCtrl(self.background, -1, "", size=(140, -1))

        self.horizontalRow0 = wx.BoxSizer()
        img1 = wx.Image("logo1.bmp", wx.BITMAP_TYPE_BMP, -1)
        self.bitmap1 = wx.StaticBitmap(self.background, -1, wx.BitmapFromImage(img1), (55, 0))
        self.horizontalRow0.Add(self.bitmap1, wx.Center, border=10)

        self.VerticalRow1 = wx.BoxSizer(wx.VERTICAL)
        self.VerticalRow1.Add(wx.StaticText(self.background, -1, "Tickets Closed Last 24 Hours",
                                            style=wx.ALIGN_CENTER), flag=wx.ALL, border=5)
        self.VerticalRow1.Add(wx.StaticText(self.background, -1, "Address:",
                                            style=wx.ALIGN_CENTER), flag=wx.ALL, border=9)
        self.VerticalRow1.Add(wx.StaticText(self.background, -1, "Unit Number:",
                                            style=wx.ALIGN_CENTER), flag=wx.ALL, border=9)
        self.VerticalRow1.Add(wx.StaticText(self.background, -1, "City:",
                                            style=wx.ALIGN_CENTER), flag=wx.ALL, border=9)

        # To add labels - H-1 V-2
        self.VerticalRow2 = wx.BoxSizer(wx.VERTICAL)
        self.VerticalRow2.Add(self.some_text, proportion=1, flag=wx.ALL, border=6)
        self.VerticalRow2.Add(self.Address, proportion=1, flag=wx.ALL, border=6)
        self.VerticalRow2.Add(self.UnitNumber, proportion=1, flag=wx.ALL, border=6)
        self.VerticalRow2.Add(self.City, proportion=1, flag=wx.ALL, border=6)

        # Combine V-1 And V-2 to H1
        self.horizontalRow1 = wx.BoxSizer()
        self.horizontalRow1.Add((30, 30), proportion=0, flag=wx.EXPAND, border=0)
        self.horizontalRow1.Add(self.VerticalRow1, proportion=.5)
        self.horizontalRow1.Add(self.VerticalRow2, proportion=0)

        # To add labels - H-3 V-8
        self.VerticalRow1 = wx.BoxSizer(wx.VERTICAL)

        # To add labels - H-4 V-9
        self.horizontalRow4 = wx.BoxSizer()
        self.horizontalRow4.Add((30, 30), proportion=.5, flag=wx.EXPAND, border=0)
        self.horizontalRow4.Add((30, 30), proportion=1, flag=wx.EXPAND, border=0)

        # Adds horizontal Rows to Main Window in Vertical boxes
        self.verticalBox = wx.BoxSizer(wx.VERTICAL)
        self.verticalBox.Add(self.horizontalRow0, proportion=0, flag=wx.EXPAND, border=10)
        self.verticalBox.Add((10, 10), proportion=0, flag=wx.EXPAND, border=10)
        self.verticalBox.Add(self.horizontalRow1, proportion=0, flag=wx.EXPAND, border=0)
        self.verticalBox.Add((10, 10), proportion=0, flag=wx.EXPAND, border=10)
        self.verticalBox.Add(self.horizontalRow4, proportion=0, flag=wx.EXPAND, border=0)

        self.background.SetSizer(self.verticalBox)
        self.Show()

    def someFunction(self):
        mysql_data = databasemodel.returnData()  # query your database to return a string
        self.some_text.SetLabel(mysql_data)


if __name__ == '__main__':
    app = wx.App(redirect=False)
    window = MainFrame()
    app.MainLoop()
</code></pre>

<p>Any help would be appreciated.</p>

<p>Thanks! </p>