r/programminghelp • u/[deleted] • Sep 02 '20
Python SQLite Database Query
Hey all,
I'm creating a little fun project of a macros tracker using Python GUI modules and SQLite3.
One part that i'm stuck on and have tried to ignore it for days is inputting information to a database using a dropdown box.
For example the dropdown box could have: chicken
mince
chocolate
Now if I select one of these and click submit, I want the submit button to input the selected item (e.g chocolate) along with it's macros (protein, carbs, fats) to a new database.
At present I can only send the name to the new database and not the other macros alongside it.
Any help would be great,
Many Thanks
1
Sep 02 '20
Post your existing code (Rule #2)
1
Sep 02 '20
Good rule.
7 hours later and I've just solved this, over the moon!
1
Sep 03 '20
Just remember to give the rules a look over the next time you post so it doesn't get removed.
1
u/amoliski Sep 02 '20
How are you planning on using the data in the database?
When you say the protein/carbs/fats for each item are in another database, do you mean it's in a database that you control, or is it someone else's database you are accessing with an API? Or do you just mean a separate table within your own database?
1
u/[deleted] Sep 02 '20
I should also note the protein,carbs,fats for each item in the drop down is stored in a different database, so it's just a matter of accessing this using the name and then inputting that to a new database