Take the 2-minute tour ×

So I'm working on a authentication system for my C# apps, the authentication system is in PHP. It has users and it works perfectly right now for 1 person. Such as myself. I can add my own customers, set their permissions, update my program, and do much more.


I want it to work so that I can have users sign up with a developer account from which they can control their own customers. But the problem is, with just my account I already have three tables. (customers, files, and global)

So should I make a whole new table for every customer? Or should I just shove them all in one huge table, with a column stating the ID of their parent developer.

I really hope this was clear enough...

If you're still confused here's some pics which may help (This is the three tables I need for just my developer account)

(Don't worry these are not my actual users passwords... I'm still working on the website, it's all example stuff now)

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You should put them all in one table with an ID linking them to the parent / any other information you need to store.

You could even have a customer type column as well if you need to differentiate.

Either way, having a new table for each user is not the right way.

EDIT: If you are worried about the size of the table then don't be. As long as you implement correct indexing then accessing this information won't be a problem. MySQL can handle millions of records in a table.

share|improve this answer
Yes I was considering this way, I just thought it might be a bit impractical to have a huge table of all the customers, I thought there would be a better more organized way. Regardless thank you for your answer! +1 for you sir. –  Racialz Feb 12 '13 at 8:27
MySQL tables can handle millions of records, I don' think you will have a problem. I will update my post to include some information. –  webnoob Feb 12 '13 at 8:28
s/millions/billions or more –  Patashu Feb 12 '13 at 23:47
@Patashu - My experience has only ever been in the millions (up to about 25 million records) so didn't want to overdo my respect for MySQL DBs :) If it can handle billions, great! –  webnoob Feb 13 '13 at 8:14


So, you have a one to many relationship.

A table of users...

And a table of customers, who have a foreign key referencing user.

That's two tables. If you think you need to make new tables for every user, or any similar idea like that, you are almost certainly wrong.

share|improve this answer

Your Answer


