You can create a new site in the /sites/folder and in the settings file you can set the database to point to the same database as the default site. Or you can share tables between multiple sites, but with a common file system. (Makes it really easy to upgrade multiple sites under the same codebase.)
How are you looking to implement this ? - are you looking to install two sites into the same database and then use them across two sites, or are you looking at two different sites using the same database (or part of ie: logins etc) ?
Then you can edit the settings.php file in each subdirectory and setup each sites database connection settings. If you want to share tables, you add it to the settings.php file, so it knows where to find the tables, if they arent in the main site.
Ok - This assumes you want to run 2 drupal sites in One Database - Drupal offers table prefixing.
In order to use this feature, you must currently edit the script database/database.mysql and change all the create table lines to include a prefix for your tables
eg:
Change - CREATE TABLE access
To - CREATE TABLE site1_access
Then use site1_ (in this example) as value of $db_prefix in your sites/default/settings.php file.
When you need to do the second site - you dont need to have a second file install of drupal, just create a folder under /sites with the url of the second website and follow the same steps above, but this time change the prefix to siteb_ and then set the $db_prefix variable in the /sites/www.siteb.com/settings.php to use the new prefix.
Point both websites to the same directory of your Drupal install, and drupal will handle the different sites.
This will have 2 different drupal instances running off the same database & the same filestructure, but with different data. It's handy when you want to install a theme or module and make it available across multiple sites.
Hope this makes sense - let me know if you need anything else.
The Icons I do manualy - its a good way for me to apply some keywords in the ALT tag on the image to re-inforce the articles content when Google comes to Visit.
I have a PSD and a list of all the icons available on my site here:
Regarding themes: There are two ways you can do it, one is with a separate install of Drupal for each database. The other is to lock the theme down in the settings.php file.
Eg: One Drupal Install with Two Themes Installed (SiteA and SiteB)
In the settings.php file you can hardcode some settings - This will disable them in the admin panel on that site as it overides anything the user sets.
$conf = array(
// 'site_name' => 'My Whizzy Site B Drupal Install',
'theme_default' => 'SiteB',
);
You can overide anything in the Variables Table by setting it in the settings.php file.
Multiple Install against a Single Database
You can create a new site in the /sites/folder and in the settings file you can set the database to point to the same database as the default site. Or you can share tables between multiple sites, but with a common file system. (Makes it really easy to upgrade multiple sites under the same codebase.)
How are you looking to implement this ? - are you looking to install two sites into the same database and then use them across two sites, or are you looking at two different sites using the same database (or part of ie: logins etc) ?
what are you trying to achieve?
I'm not understanding...
Drupal on Multiple Site
You can use Drupal to create multiple sites that share databases / or tables within a database.
For example:
Site A: Has all the users you want to authenticate with, but a Site B is where you want the articles to go.
or:
Site A and B are running off the same drupal install - but have completely different databases.
It's done by creating a subfolder in your sites directory.
/sites/default
/sites/support.creativebits.org
/sites/store.creativebits.org
etc.
Then you can edit the settings.php file in each subdirectory and setup each sites database connection settings. If you want to share tables, you add it to the settings.php file, so it knows where to find the tables, if they arent in the main site.
eg:
$db_url = 'mysql://:@localhost/databaseA';
$db_prefix = array(
"users" => "databaseB.",
);
There are multiple scenarios on how you can setup the sites, it all depends on what you hope to achieve / have access to do etc.
(I think the more I explain it - the more it looks like I am translating from a Japanese computer manual into English)
If you can give me an idea of what you want to achieve, I may be able to explain it better.
Two completely differet sites.
One is localized and in the other in english, with different posts, users, galleries, etc.
Thanks for the help so far...
Multiple Instances in a single database
Ok - This assumes you want to run 2 drupal sites in One Database - Drupal offers table prefixing.
In order to use this feature, you must currently edit the script database/database.mysql and change all the create table lines to include a prefix for your tables
eg:
Change - CREATE TABLE access
To - CREATE TABLE site1_access
Then use site1_ (in this example) as value of $db_prefix in your sites/default/settings.php file.
When you need to do the second site - you dont need to have a second file install of drupal, just create a folder under /sites with the url of the second website and follow the same steps above, but this time change the prefix to siteb_ and then set the $db_prefix variable in the /sites/www.siteb.com/settings.php to use the new prefix.
Point both websites to the same directory of your Drupal install, and drupal will handle the different sites.
This will have 2 different drupal instances running off the same database & the same filestructure, but with different data. It's handy when you want to install a theme or module and make it available across multiple sites.
Hope this makes sense - let me know if you need anything else.
Cheers
Andy
Thanks! This is a great
Thanks! This is a great solution when your hosting co only allows one database.
Thanks alot! One more thing,
Thanks alot! One more thing, how do you get those neat icons to appear in your posts on your site depending on category?
By the way, does this share
By the way, does this share the themes? I'ld like both to have different themes.
Themes and Icons
The Icons I do manualy - its a good way for me to apply some keywords in the ALT tag on the image to re-inforce the articles content when Google comes to Visit.
I have a PSD and a list of all the icons available on my site here:
http://www.theevilpixel.com/node/92
Regarding themes: There are two ways you can do it, one is with a separate install of Drupal for each database. The other is to lock the theme down in the settings.php file.
Eg: One Drupal Install with Two Themes Installed (SiteA and SiteB)
In the settings.php file you can hardcode some settings - This will disable them in the admin panel on that site as it overides anything the user sets.
$conf = array(
// 'site_name' => 'My Whizzy Site B Drupal Install',
'theme_default' => 'SiteB',
);
You can overide anything in the Variables Table by setting it in the settings.php file.