in my project, the user can enter categories into a budget. So the user enters an annual amount in a form field. They can then select "monthly" or "annual" from a dropdown menu, and also select which month they want the annual category to start on. So if they select annual and June, then records would be stored into the categories table, one for each month (June, July, August, etc.).
Here's my problem. I want to be able to get a running sum total of the amounts in a particular category to display to the user on the page, but when an annual category is stored to the database, its given a unique id as the primary key, and that's obsiously auto-incremented.
So where I would normally select records where the ID = x, I can't do that because the ID is not the same.
The only way around it that I can think of is to get them by category name since they would all be the same. Is that even ok to do? There's nothing to stop the user from going in and creating another category with the exact same name, since the name is not unique.