Saving and retrieving values from a database

Hi all, I am currently coding a function for a finance app that ranks the categories that the user has spent their money on from the least to the most. Here's how it going to work:

  1. The app calculates the budget and actual amount of the user’s expenses for each category, it will make a list of the budget and actual amounts for each category.
  2. The app will then find the differences between the actual amount and budget amount for each category.
  3. The app will then rank the list from the smallest to the largest differences in budget and actual for each category.
  4. The app will then take that ordered list of categories and insert it into a temporary database.
  5. The app will then turn the differences in each category that it represents (Home Expenses, Utilities, Food, etc).
  6. The app will then display the text from the database into the notifier that will pop up.

I have coded all the way until the fifth step where the app is supposed to turn those values into their respective categories. I have created a database with the help of other MIT developers, however when creating a database, I have also saved the users' values into this table/database for this ranking process to be possible. Now, my saving algorithm for this app does not seem to be working. Below are my blocks, if anyone knows what is wrong with my code, please let me know ASAP! I need to get this app finished as soon as possible! Thank you!








Show us.

1 Like

tinyDB is really not a good choice for this kind of app. Sqlite is highly recommended.

4 Likes

I just tested it again and most of the values have been saved except for these three values which doesn't make sense since they should all be somewhat identical. The values that are not saving are the ones circled in red

Why do you need to store so many data? Did you try to put everything in lists and organize them?

1 Like

The table arrangement mixed up your text boxes. Rename them to find the mixup. Also rename the picture files.

CAPS on monthlyincom

Textbox 12 is missing an n, should be transportation

Textbox 15 you are saving the wrong value to db

2 Likes

Thanks @Boban, I have just fixed all of these silly mistakes and it is now working again! Thx a lot!

1 Like