SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Newbie Needs Help: PHP Unable to Connect Error

    Hey Guys,

    I'm just teething at PHP..

    I think this may be something really basic. Any help is greatly appreciated..

    I'm trying to get a search script to work. It is working on our old host. We transfered hosts. Exported and imported the database from the old host to the new host. The database is ready and populated.

    I found the section of the script that held the database configuration, and added the new database info. Apparently its not connecting. I have double triple checked the new database info and it's correct. I'm wondering if I am missing some parameter? The old database was local and the new is hosted on a separate server.

    These are the error messages. (I had to use images because I'm new here and could not post anything with web addresses)



    Relative Script Lines:





    Regards,
    C.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The first error hints at your problem, your database credentials are incorrect.

    Even if you think they're not I'm afraid.

    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could it be that the previous database was "local" and that now that I'm using a database on a separate server the call needs different code?

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    No, it shouldn't make much difference, unless of course the user account you're trying to use only has permission to access the database from localhost.

    Try using MySQL Administrator to connect to your server using the preferred credentials, if you're successful, it's PHP that is at fault.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


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
  •