Re: [PHP] Two websites need to share part of onedatabase,suggestions please
Chris W. Parker wrote: Robert Cummings mailto:[EMAIL PROTECTED] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Two websites need to share part of onedatabase,suggestions please
On Mon, 2005-07-11 at 14:29, Chris W. Parker wrote: Robert Cummings mailto:[EMAIL PROTECTED] 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'? Sorry to respond so late, my free time these days is sporadic :) My example suggested one database to host all products for both sites. The bitmask is used as a filter to determine which sites can access the product information. In this way you keep your products centralized while providing easy access for either site 1 or site 2 customers. I also mentioned when I first suggested it, and as another response mentioned, that you could go with a separate table that provides site to product relationships and that would be scalable to many more sites. My suggestion was merely for increased efficiency based on your mention that you only have two sites in the equation. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Two websites need to share part of onedatabase,suggestions please
Robert Cummings mailto:[EMAIL PROTECTED] 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'? Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php