this is a perfect explination, I was concerned about the same webserver
(split into virtual) accessing different databases.

Out of interest can anyone think of ANY problems this virtual setup may
cause ? ie memory, transaction time, dns even, just anything at all so I am
trying to evaluate possiblities for different ideas.

Thanks,

Matt.

PS is anyone interested in working on any projects, I am new to both PHP and
MYSQL and I am trying my hand at some new projects, I am quite competant in
Oracle, C++, VB, Unix so it is not quite the same as working with a non
programmer.

If you are interested drop me a personal mail.



-----Original Message-----
From: j.urban [mailto:[EMAIL PROTECTED]]
Sent: 06 January 2002 15:44
To: Matthew Darcy
Cc: [EMAIL PROTECTED]
Subject: Re: Using MYSQL and PHP With Vitual Apache Servers ?


Why not just create separate databases for each virtual server?  It sounds
like a perfect situation to create multiple databases, as databases do
provide data separation...

mysql> create database Virtual1;
mysql> create database Virtual2;
mysql> create database Virtual3;
mysql> create database Virtual4;

mysql> show databases;
+----------+
| Database |
+----------+
| Virtual1 |
| Virtual2 |
| Virtual3 |
| Virtual4 |
+----------+

And then in the PHP code for each website, you connect to the appropriate
database.

Say for website Virtual2:

$dbh = mysql_connect("localhost","user","pass");
mysql_select_db('Virtual2');

... Access schema for website Virtual2 ...


http://www.mysql.com/doc/C/R/CREATE_DATABASE.html
http://www.php.net/manual/en/function.mysql-select-db.php

Good luck.

On Sun, 6 Jan 2002, Matthew Darcy wrote:

> I have a redhat server, running apache 1.3.20. The server is running a
> couple of virtual servers for different websites. I now wish to add a few
> new virtual servers/domains to the machine. However (here is the twist)
> these sites will need to use a different mysql schema each and have some
of
> the content generated with php based on the data from the different mysql
> databases.
>
> Is this possible ??? if so what is needed to configure this setup (just
> brief), and I would be very interested in hearing from someone who is
> running virtual servers with each site using a different mysql database.
>
> Thanks,
>
> Matt.
>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to