Re: Two websites need to share part of onedatabase,suggestions please

From: Date: Tue, 12 Jul 2005 08:48:23 +0000
Subject: Re: Two websites need to share part of onedatabase,suggestions please
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218520@lists.php.net to get a copy of this message
Chris W. Parker wrote:
Robert Cummings <mailto:robert@interjinn.com>
    on Friday, July 08, 2005 5:25 PM said:
Thus siteMask should have one of the following values:
   (1 << 1) == 2                   // only site1 can use the product.
   (1 << 2) == 4                   // only site2 can use the product.
   ((1 << 1) | (1 << 2)) == 6      // both sites can use the product.
Thanks for the example. But I'm still at a loss as to what strategy I should take regarding tables. Should I create two databases where one database has the product information and the other does not? Or should I create one giant database with duplicate tables? That is, one database with 'customers' and 'customers_two'?
I think this would be a great candidate for a webservice. You could write methods that restrict access to only the particular tables that the other site requries, and then track access by logging requests to the service. So all the other site needs to know is getCustomers(), and you can code whatever SQL is necessary to fetch the information. As far as the database structure itself, I think a view (if supported) could be used here. Hope this helps, Burhan

« previous php.general (#218520) next »