Project

General

Profile

« Previous | Next » 

Revision 1928

Added by darkviper over 11 years ago

class WbDatabase fixed select_db() for multiconnection modus

View differences:

WbDatabase.php
115 115
		}
116 116
		$this->_db_handle = @mysql_connect($hostname.$hostport,
117 117
		                                   $username,
118
		                                   $password);
118
		                                   $password,
119
		                                   true);
119 120
		if(!$this->_db_handle) {
120 121
			throw new WbDatabaseException('unable to connect \''.$scheme.'://'.
121 122
			                           $hostname.$hostport.'\'');
122 123
		} else {
123
			if(!@mysql_select_db($db_name)) {
124
			if(!@mysql_select_db($db_name, $this->_db_handle)) {
124 125
				throw new WbDatabaseException('unable to select database \''.$db_name.
125 126
				                           '\' on \''.$scheme.'://'.
126 127
				                           $hostname.$hostport.'\'');
127 128
			} else {
128 129
				if($this->sCharset) {
129
					@mysql_query('SET NAMES \''.$this->sCharset.'\'');
130
					@mysql_query('SET NAMES \''.$this->sCharset.'\'', $this->_db_handle);
130 131
				}
131 132
				$this->connected = true;
132 133
			}

Also available in: Unified diff