Access a database on another domain
am 03.08.2009 04:05:46 von Neil Jackson
--------------060408070801060109050208
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I host a number of running clubs websites. They are all hosted on
different domains on a hosting service.
They all share a common database table of fixtures. At present I have
copied the database table to each domain but this time consuming.
I want to have a central database with the individual clubs accessing
the table from their domains
At present I do it like this
$result = @mysql_pconnect("localhost", "username", "password");
$query = "SELECT * FROM fixtures ORDER BY event_name";
Two of the domains are www.hillcrestvillagers.co.za and www.pmb42.co.za.
Thanks for the help
Neil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAkp2RfoACgkQGgk1S8edB3I48ACeODQFinlcJIFuaxFItREa bRxt
zGAAn1Vde3l6f6eVZtnv/xLQRS/YOYi4
=refm
-----END PGP SIGNATURE-----
--------------060408070801060109050208
Content-Type: text/plain; charset=us-ascii
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------060408070801060109050208--
Re: Access a database on another domain
am 03.08.2009 04:15:05 von dmagick
Neil Jackson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> I host a number of running clubs websites. They are all hosted on
> different domains on a hosting service.
>
> They all share a common database table of fixtures. At present I have
> copied the database table to each domain but this time consuming.
>
> I want to have a central database with the individual clubs accessing
> the table from their domains
>
> At present I do it like this
> $result = @mysql_pconnect("localhost", "username", "password");
> $query = "SELECT * FROM fixtures ORDER BY event_name";
I haven't seen a question here, but I assume you don't know where to start.
Enable remote access to mysql:
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access- to-mysql-database-server.html
Then connect to it:
mysql_connect('server.name', 'username', 'password');
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Access a database on another domain
am 03.08.2009 05:13:59 von Phpster
On Sun, Aug 2, 2009 at 10:15 PM, Chris wrote:
> Neil Jackson wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>> I host a number of running clubs websites. They are all hosted on
>> different domains on a hosting service.
>>
>> They all share a common database table of fixtures. At present I have
>> copied the database table to each domain but this time consuming.
>>
>> I want to have a central database with the individual clubs accessing
>> the table from their domains
>>
>> At present I do it like this
>> =A0 =A0 =A0 =A0$result =3D @mysql_pconnect("localhost", "username", "pas=
sword");
>> =A0 =A0 =A0 =A0$query =3D "SELECT * FROM fixtures ORDER BY event_name";
>
> I haven't seen a question here, but I assume you don't know where to star=
t.
>
> Enable remote access to mysql:
>
> http://www.cyberciti.biz/tips/how-do-i-enable-remote-access- to-mysql-data=
base-server.html
>
> Then connect to it:
>
> mysql_connect('server.name', 'username', 'password');
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
You should be able to access this by creating a shared mysql account
and setting the different domains to use it.
--=20
Bastien
Cat, the other other white meat
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php