Hi Susan,

instead of "localhost" you have to use http or IP address (i.e. 
192.168.11.121) of the main site. Furthermore, even though you have enabled 
access to MySQL from your other sites still your hosting provider MUST enable 
access to the MySQL port (usually 3306) from "foreign" addresses.

This usually isn't a problem if you're using a dedicated hosting server but 
the problem may arise if your main site is hosted in a shared environment 
since allowing access to any service from address other than local presents a 
significant security threat to all the users of the shared hosting server.

Regards, 

-- 
Bratislav Velickovic
DBA/DB/WEB Designer
www.velickovic.net

> I have several sites that need to use a single database. Each site is
>  on a domain of its on with the database on a separate domain. I
>  usually use :
>
>  -----
>  $connection = mysql_connect("localhost","username","password") or
>  die("Couldn't make a connection.");
>
>  $db = mysql_select_db("database", $connection)
>  or die("Couldn't select database.");
>  -----
>
>  ...but since the database is not on the "localhost", how do I form the
>  php code to link to an external database?
>
>  I have set the external sites as "Access Hosts" on the main site. What
>  do I do to connect these external sites to the main database?
>
>  Thanks,
>
>  Susan
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to