The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Try out my first PHP web app! Reply To: Try out my first PHP web app!


I misread the question. (sorry! edited my post.)

As far as lookup time goes, DNS lookup for “localhost” happens on your local machine (that’s what the hosts file is for), so it will actually be much quicker than DNS lookup for any address you visit on the web. Yes, if you use the IP address you don’t need to do a lookup at all, but you will never notice the difference in speed.

Using the IP address for your DB connection actually has more to do with the possibility that “localhost” won’t successfully find your DB at all (so, yes, do it). “localhost” will either work or it won’t; it’s not a speed issue.