You are here: Re: Connection to a database on an external server « PHP Programming Language « IT news, forums, messages
Re: Connection to a database on an external server

Posted by Gordon Burditt on 10/13/07 19:01

>I have my own database on a server and the same database on local.

Does that mean *TWO DIFFERENT MACHINES*?

Many hosts do not permit database access from arbitrary hosts
for "security reasons".

>I want to copy all my database from the main server to my local host
>(I execute this code from my PC and not my main server)
>
>$id_link_ref = mysql_connect('localhost','database_name','password');
>$id_link_local = mysql_connect('localhost','root','password');

If you are trying to open a connection to two different machines,
shouldn't one of the hostnames NOT be 'localhost'? Also, the second
argument to mysql_connect is a username, NOT a database name,
although they might coincidentally be the same.

>it doesn't work :(

How do you know it failed?

>Why ? What is the problem ?

What was the error message?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация