Reputation: 175
I have several databases with same tables. Anytime a user registers on my app a new database is created for him/her with same tables as all the other dbs.
Now what I want to do is
The idea is to show how much transaction pass through my system. so I want to add the total price of each users products together to get the sum of all transaction been carried out on my system and echo it.
I am new to programming so I would appreciate detail explanation of the solution
Upvotes: 2
Views: 424
Reputation: 11213
This does not answer your question.
You should stop now and change your design. There is no reason that you should ever, ever, ever create a new table for every user, let alone a new DB. This is really, really inefficient, resource hungry and will get very complicated very quickly (as you are finding out).
Change your design today to put all your users in a single table in a single database.
Upvotes: 3