SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    localhost vs computer name

    I'm using db_connect() in php to trying to get it to list my available databases on my computer and here's the problem I'm running into.

    I'm connecting to localhost and it's saying I have no databases (which I do) but looking into WinMySQLadmin, it has the databases listed under CMCblah blah blah which is my computer's name. I, supposedly, can't change that because of the cable modem. But if MySQL is calling localhost something different than localhost, I'm assuming that's why when I do a db_connect() it's connecting but looking in the wrong area to list.

    So the question of this is, how do I want to get either localhost to show up with databases in it or do I need to reconfigure everything else to point to my computer name?

    Any suggestions?

    Thanks
    Zoya

  2. #2
    Shiver me timbers!! anthony_irl's Avatar
    Join Date
    Aug 1999
    Location
    Dublin, Ireland
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the host name in db_connect() use 127.0.0.1 that's the IP address of the localhost and will remain the same no matter what the computer is called.
    Anthony - How's tings?

    24 hours in a day, 24 beers in a case. Coincidence? I think not.
    Contact me by: PM Email NEW! Carrier Pigeon


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •