Skip to content
Advertisement

How to get different values from different tables in Treeview / Tkinter (SQLite)?

I’ve been working with Tkinter and I’m trying to get different columns from different tables in my Treeview, I’m using SQLite as database, in my first table called registers i got different columns idcard, name, surname, cellphone, address, email, etc in my second table named attendance I use to store my entries attendances by ID number I mean I got two entries cardin = entry1 and cardout = entry1 so if one of my entries match with my registers table idcard, it automatically store idcard, timein, timeout, date in my attendance table till that it works so good, but I can´t get the names, surnames columns from my first table registers and store them in my second table attendace same as my idcard, timein, timeout, date (the idcard, names, surnames must match from the first table), I was trying to solve it but I falied, I really have no idea how to do it, any help thanls in advance. have a good day. Here is my code:

JavaScript

Advertisement

Answer

Assign a variable to fetched data and then index it and proceed:

JavaScript

It is important to assign variable to c.fetchall() as it behaves like a generator object and loses its items once its been used.

Advertisement