* @return resource False on error
*/
protected function doQuery( $sql ) {
+ $conn = $this->getBindingHandle();
+
if ( $this->bufferResults() ) {
- $ret = mysql_query( $sql, $this->mConn );
+ $ret = mysql_query( $sql, $conn );
} else {
- $ret = mysql_unbuffered_query( $sql, $this->mConn );
+ $ret = mysql_unbuffered_query( $sql, $conn );
}
return $ret;
* @throws DBConnectionError
*/
protected function mysqlConnect( $realServer ) {
- # Fail now
- # Otherwise we get a suppressed fatal error, which is very hard to track down
+ # Avoid a suppressed fatal error, which is very hard to track down
if ( !extension_loaded( 'mysql' ) ) {
throw new DBConnectionError(
$this,
* @return bool
*/
protected function mysqlSetCharset( $charset ) {
+ $conn = $this->getBindingHandle();
+
if ( function_exists( 'mysql_set_charset' ) ) {
- return mysql_set_charset( $charset, $this->mConn );
+ return mysql_set_charset( $charset, $conn );
} else {
return $this->query( 'SET NAMES ' . $charset, __METHOD__ );
}
* @return bool
*/
protected function closeConnection() {
- return mysql_close( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_close( $conn );
}
/**
* @return int
*/
function insertId() {
- return mysql_insert_id( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_insert_id( $conn );
}
/**
* @return int
*/
function affectedRows() {
- return mysql_affected_rows( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_affected_rows( $conn );
}
/**
* @return bool
*/
function selectDB( $db ) {
+ $conn = $this->getBindingHandle();
+
$this->mDBname = $db;
- return mysql_select_db( $db, $this->mConn );
+ return mysql_select_db( $db, $conn );
}
protected function mysqlFreeResult( $res ) {
}
protected function mysqlRealEscapeString( $s ) {
- return mysql_real_escape_string( $s, $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_real_escape_string( $s, $conn );
}
protected function mysqlPing() {
- return mysql_ping( $this->mConn );
+ $conn = $this->getBindingHandle();
+
+ return mysql_ping( $conn );
}
}