how do you read the data from TinyDB again?
As Taifun said... you've shown how you save the data. Where are you READING the data back??? Show a screenshot.
Here is my save routine.
I want to be able to do:
1. Add New
2. Update
3. Delete current record
4. DELETE ALL records
What this is a training app for new police recruits. We log the progress every day of training. I email the results back to office for more processing. At the end of the training, I want to clear out the database and start fresh for the new one.
I found my problem for loading the data but now I need to figure out how to UPDATE the record without adding a new one. Is there an example on how to do this?
I will post my final example for all to view when it is working.
Jim... Just write the info to the TinyDB using the same tag... it'll overwrite the existing information for that tag.
So, I'll check to see if the record exist and if it does, report the ELSE routine, correct?
That's correct. If it exists, it'll overwrite it. If it doesn't exist, it'll add it.
Excellent! It's working like a charm.
The last thing I need to do is the delete the entire DB once the training has been completed.
The only way to do that Jim, is to use the Clear Tags block... But be CAREFUL because it will, as it says, clear all tags and if done when any of your training is active, you'll lose everything. I'd password protect access to that...
Thank you Enis. Is there an example on to use the Clear Tag All?
댓글 없음:
댓글 쓰기