Error messages from WP after installing Multi-DB

Fresh install of WP 3.4 RC1 with subdomains. Using Mamp Pro and have added a custom domain in terminal (sitename.lo). Also I have moved the wp-content folder to another structure using the built in WP functionality. So I changed url in the hardcoded db.php file.

This three messages appear when trying to access the admin area (which I can access). In the frontend, only the top one is displayed.

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in /Users/*SITELOCATION*/wp-includes/wp-db.php on line 554

Warning: Cannot modify header information - headers already sent by (output started at /Users/*SITELOCATION*/wp-includes/wp-db.php:554) in /Users/*SITELOCATION*/wp-includes/option.php on line 563

Warning: Cannot modify header information - headers already sent by (output started at /Users/*SITELOCATION*wp-includes/wp-db.php:554) in /Users/*SITELOCATION*/wp-includes/option.php on line 564

  • enkreativbyra
    • Design Lord, Child of Thor

    Hi!

    It was a blank line at the bottom of db.php, but I still see the mysql_set_charset error.

    And when I try to login it doesn't redirect to admin, but when I go to admin/network it works. And then I can access just admin as well.

    EDIT
    Sorry, tested it some more and in the subsites it still shows the header warning and the mysql warning.

    Warning: Cannot modify header information - headers already sent by (output started at /Users/*SITELOCATION*/wp-includes/wp-db.php:554) in /Users/*SITELOCATION*/wp-includes/option.php on line 564

    Any ideas?
    Thank you!

  • enkreativbyra
    • Design Lord, Child of Thor

    It also says:

    Warning: Cannot modify header information - headers already sent by (output started at /Users/*SITELOCATION*/wp-includes/wp-db.php:554) in /Users/*SITELOCATION*/wp-includes/pluggable.php on line 881

    when I try to add, bin or delete posts/pages, or update anything in general in both main and sub-sites.

    It seems like it's the following snippet from wp-db.php that is screwing things up. (Line 26 is line 554)

    /**
    	 * Sets the connection's character set.
    	 *
    	 * @since 3.1.0
    	 *
    	 * @param resource $dbh     The resource given by mysql_connect
    	 * @param string   $charset The character set (optional)
    	 * @param string   $collate The collation (optional)
    	 */
    	function set_charset($dbh, $charset = null, $collate = null) {
    		if ( !isset($charset) )
    			$charset = $this->charset;
    		if ( !isset($collate) )
    			$collate = $this->collate;
    		if ( $this->has_cap( 'collation', $dbh ) && !empty( $charset ) ) {
    			if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) {
    				mysql_set_charset( $charset, $dbh );  // Line 554
    				$this->real_escape = true;
    			} else {
    				$query = $this->prepare( 'SET NAMES %s', $charset );
    				if ( ! empty( $collate ) )
    					$query .= $this->prepare( ' COLLATE %s', $collate );
    				mysql_query( $query, $dbh );
    			}
    		}
    	}

    Help is greatly appreciated!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.