MySQLi cannot connect to server

Discussion in 'PHP' started by RyanDoubleyou, Mar 15, 2010.

  1. #1
    Using PHP installed on Windows Server 2008 I attempt to connect to an external MySQL DB, but get the following error:
    On lines 172-181 in class_DbConnect.php I have the following code:
    function connect()
    	{
    		self::$instance = new mysqli($this->DB_HOST, $this->DB_USERNAME, $this->DB_PASSWORD, $this->DB_DATABASE);
    		
    		if (mysqli_connect_errno()) {
    			$this->raise_error(printf("Connect failed: %s\n", mysqli_connect_error()));
    		}
    		
    		return self::$instance;
    	}
    PHP:
    Any ideas on what is going on? In my php.ini I have enabled the php_mysqli.dll extension. Please let me know if any more information is needed, and thanks in advance for any help.
     
    RyanDoubleyou, Mar 15, 2010 IP
  2. RyanDoubleyou

    RyanDoubleyou Peon

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    B u m p
     
    RyanDoubleyou, Mar 16, 2010 IP
  3. odrey

    odrey Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi..
    are the username and the password are correct ?
    are the mysql server is running ?
     
    odrey, Mar 29, 2010 IP