I'd like to apologize to both of you, this is my fault as i did not really clear what my requirements are .

basically it will be for my VoIP system, Customer A (which is me) will have customers that may also be a reseller, so this is where Cust 1 will have Cust B. Each customer will have a login name, that they can use to check cdr's, view their rates, create rates for their customers (if customer is a reseller, so that they can top-up whatever rate was assigned to it by its parent) billing (sending invoice via e-mail) and trouble ticket. that's what is in the plan for now.

Thank you


TG wrote:
Nice blanket statements, Bob. What, exactly, is wrong with what I'm describing?

What I've tried to do, without having more information about the type of data and how he intends to use it, is give a high level idea of things that could be tried. There's no way I can give an exact breakdown of exactly how to configure anything without more information. All I did was outline some general schemes that COULD be used on a high level.

Not trying to start a fight, but your message is borderline trolling (and of course I'm responding... falling for it.. but I assume it wasn't meant as a troll post).

It's not the BEST advice I could give because I don't have all the information. Not saying I'm the smartest person on this list, but when someone is looking for ideas, some ideas to try.. so you can grow and learn at the very least.. are better than none. If a better idea comes along, all the better. Hopefully the better solution will get posted to the list.

I'm not sure anything I said is as backwards as you make it out to be. So let's keep it constructive. If you can point out clearly what I said that's terribly wrong and give a better solution, please enlighten. Always willing to learn new things if they are, indeed, better.


----- Original Message -----
From: "Bob Chatman" <[EMAIL PROTECTED]>
Cc: nhadie <[EMAIL PROTECTED]>, php-db@lists.php.net
Date: Fri, 28 Sep 2007 23:23:41 -0700
Subject: Re: [PHP-DB] newbie help

This is definitely not the best advice in the world. The truth is you could
staple your eye lids open and never blink, but it wouldn't be very
beneficial. I highly suggest you invest some of your time in reading about
databases and how relational databases work, and more than that how they
work well, instead of trying to create some monster that will end up causing
you more stress than income.

I would also suggest you sit down and try to plan out whatever the hell you
are trying to do before you get too crazy. If you code like you describe
things here you are bound to confuse variable names and thats just crazy.
Try to clean up your idea and ill gladly direct you to some of your options.
and most of all, dont try to do this as TG has described here.

On 9/28/07, TG <[EMAIL PROTECTED]> wrote:
How resource intensive it is depends a lot on how much data you have and
you're doing with it.   You want to reduce the number of connections and
disconnects, since those are really intensive, but if everything is on the
same server, you can do cross database queries.

As for the table size exceeding the OS limit, that'd take quite a bit of
to do.   With proper database design, that shouldn't be too much of an
issue.   If you have 2+gb of data in a single table, that's one monster

Some info here about table size restrictions for MySQL:

You could create a table and stuff it full of thousands of records and try
check the physical file size of that table's file and see how tricky it
would be to actually 'fill' a table.

Ideally, for your 'customer' table would contain just the data that was
unique to that customer.  Typically data that all your customers are going
to have a single entry for so you don't have a lot of empty spots.
Anything that you have multiple entries for or are unique to a single
customer, you could put in another table as meta data (additional
information that didn't fit in the main table).

You probably want to ignore my original parent/child threading idea.  I
just illustrating a way that you COULD do it.

What you may want to do is have a 'customers' table, which contain your
customers, then another table for the base information for your customer's
customers with an ID field that matches the entry in your 'customers'

For additional tables in the database, you could do something like you
meantioned... have "custname1_tablename1" and use a code in your
"customers" table to indicate the table prefix.

This kind of thing is used a lot in systems like phpBB, Gallery, etc so
can have multiple copies installed on the same server.  It'd be the same
idea when dealing with multiple customers.

Just make sure that the prefix you use for a customer doesn't use
that are bad for table names.

What kind of data are you thinking about storing for your customers and
customer's customers?  And what other data do you need to store for
whatever your webapp does?


----- Original Message -----
From: nhadie <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Fri, 28 Sep 2007 23:49:23 +0800
Subject: Re: [PHP-DB] newbie help

Thanks for your reply, which solution would be faster and not put too
much load on the resources of the server? single or multiple database?
If i use a single database, would i be having same tables for each
customer, e.g. if i have customerinfo table for customers of A,
would i also have customerinfo table on customer 1 and 2 and so on, but
changing the name by prefixing something to the table name e.g
i'm thinking if i use only a single table for, then i might have
problems on the file size limit of the OS, would i have that problem?

thanks again for your help, i really,really appreciate it.


TG wrote:
You could do separate databases if you want.   It all depends on how
to organize your data (keeping in mind data backup strategies and
Using separate databases on the same server, you might have another
for the 'common' data.  Any variables you store in the database that
really change and are common to all databases.  Or if you log anything
want to keep the log data in one central location, you could put it in
'common' database.

If you wanted to store all the data in one database, you could use
like forum threading techniques to show a parent/child relationship

id      name                    parent
1       customerA            NULL
2       cust1                    1
3       cust2                    1
4       custB                   2
5       custC                   2
6       custD                   3

Then it's just a matter of drilling down, collecting a list of ID's
customer and the sub-customers.

Lotsof ways to tackle this problem.


----- Original Message -----
From: nhadie <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Fri, 28 Sep 2007 11:30:42 +0800
Subject: [PHP-DB] newbie help

Hi All,

I would like to setup a system something like this

         customer A

          /        \

cust 1 cust 2

/ \ \

cust B       cust C          cust D

customer A has customer 1 and 2, cust 1 has cust B and C etc, etc.
what i'm after is when a  customer user logs in he can only see
of its customer, e.g cust A logs in, it can only see records of cust
cust 2,
if cust 2 is login it can only see cust D and so on

how would i approach this? should every customer have it's own
consisting of all tables i need e.g customer detail table,
and i will use the database name as session variable, so  that when
add records it be inserted on table under that database?

sorry if my questions are confusing, hope anyone can help me, i just
need help on how to approach it at the beginning so it will not be
later on. Thank you.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to