I apologize if it seems like I am having some trouble putting my problem into words. Basically, I am programming a messaging system where the user can send messages to other users and view their messages in an inbox. Here are some screenshots of what my database and GUI look like: https://i.stack.imgur.com/Jdm0v.jpg
This is my function for displaying the messages in the inbox:
#DISPLAY MESSAGE IN INBOX FUNCTION
def displayMessageInbox(mf, c, vm):
    recipient = config.nameInput
    cursor.execute("""SELECT CONCAT('Title: ', m.title, '\n',
                    'From: ', s.sender, '\n',
                    'Sent: ', s.timeSent)
                    FROM Message m
                    INNER JOIN SentMessage s ON m.id = s.messageID
                    WHERE s.recipient = %s""", (recipient))
    rows = cursor.fetchall()
    i = 3
    for message in rows:
        messageInfo = tk.Label(mf, text=message, bg="white", anchor=tk.W,
                               justify=tk.LEFT, width=30)
        messageInfo.grid(row=i, column=0, sticky=tk.W)
        viewReply = tk.Button(mf, text="View/Reply", anchor=tk.W,
                      command=lambda:c.show_frame(vm))
        viewReply.grid(row=i, column=1,padx=10, sticky=tk.W)
        i+=1
This is my function for displaying the message and its content after the user has clicked on "View/Reply." Note that it is selecting a specific message ID and not the one I actually want it to display. In other words, it's just placeholder.
#READ MESSAGE CONTENT FUNCTION
def readMessage(mf):
    mID = 'a6bb9c97-0f59-44ea-9f2b-759ffbac5031'
    cursor.execute("""SELECT CONCAT('From: ', sm.sender, '\n',
                'Title: ', m.title, '\n',
                'Message: ', m.content)
                FROM Message m
                INNER JOIN SentMessage sm ON m.id = sm.messageID
                WHERE m.id = %s""", (mID))
    rows = cursor.fetchone()
    message = rows[0]
    readMessageLabel = tk.Label(mf, text=message, bg="white", anchor=tk.W,
                                justify=tk.LEFT, width=100)
    readMessageLabel.grid(row=3, column=0, padx=10, sticky=tk.W)
So my problem is this... I want the user to be able to click on "view/reply" and view the corresponding message, and not just a placeholder. I don't even know how to begin solving this problem. I think that what I want to do is get the message id from a specific row in displayMessageInfo's for loop, but I'm not entirely sure. Any ideas?
 
    