Reply to Re: Cannot get mysql_connect to work

Your name:

Reply:


Posted by Jerry Stuckle on 12/28/05 15:21

Michael wrote:
> Jerry and Gordon,
>
> Thank you for taking the time to write out these superb explanations; I
> and I'm sure others appreciate it. Just a few more question, if I
> may...
>
> 1. How does the browser know that it should translate
> http:/localhost/myFile.html into /var/www/html/myFile.html? Is there an
> ini file somewhere that contains this information?
>
> 2. This thread got started because the first mysql call (see below)
> failed, but when I changed localhost to 127.0.0.1, as in the second
> call, it worked. Given the information I have from you now, I don't see
> how the first call could ever work, although the documentation says
> that it should. Any ideas?
>
> $conn = mysql_connect("localhost", "root", ""); // This fails.
> $conn = mysql_connect("127.0.0.1", "mike", ""); // This works.
>
> Thanks again for your help,
> M. McDonnell
>

Michael,

The browser doesn't know - and doesn't care. This is all done by the
web server (Apache, IIS, Tomcat, etc.), based on settings in the browser.

As for your problem - you've changed your signon id, also. In localhost
it is "root", but when you connect to 127.0.0.1, you use "mike".

In neither case do you have a password listed - so if "root" has no
password (very bad idea), it should work also.

Remember - the internet works only on ip addresses. It doesn't know
anything about "localhost", "example.com" or whatever. But your HOSTS
file should provide the translation from "localhost" to 127.0.0.1 for you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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