0
I have a table with categories, and each client who registers can choose up to 10 corresponding categories that corresponds to his work!
These categories in the client table are saved the ID’s , I need each category to show in front of them the amount of times it has been marked
Example:
Food (15) Beverages (5) Bed (5) Kitchen (20)
The table categories and so
And the clients table is recorded this way
You save the customer categories separated by commas in the bank?
– Wallace Maxters
If the answer to the above question is "yes", I recommend reading of that question
– Wallace Maxters
Difficult to know the doubt or difficulty. It would be good to edit and put some examples of the data as they are in the table, and what tried and failed.
– Bacco
@Wallacemaxters - I read the context that you gave me, but I am creating a functionality in the system that is already created some two years ago. I can’t recreate what’s already there, just trying to deploy this category counting feature. On your second answer, I’m trying to create from scratch with the examples of the tables, I did a status and it worked correctly with the mysql COUNT() function, because it was just a query in the column, and what is breaking my head of how to do!
– Marcos Paulo
@Marcospaulo as Bacco said, I think the question lacks more examples.
– Wallace Maxters
@Wallacemaxters, I understand, I liked much more the explanation of the reading that Oce gave me, since I will need to give more maintenance in this system, and probably this will affect the performance, I will talk to the customer to give a bigger slap in the system to avoid future problems. I will talk to him even if it takes a little longer but better optimize than continue the way this
– Marcos Paulo
So I’m going to close this question that I’ve undertaken and see if I can work it out with my client, if it doesn’t, I’ll reopen it and explain it further
– Marcos Paulo