}
if ( false === $ret ) {
+ $error = mysql_error( $this->mConn );
+ $errno = mysql_errno( $this->mConn );
if( $this->mIgnoreErrors ) {
- wfDebug("SQL ERROR (ignored): " . mysql_error( $this->mConn ) . "\n");
+ wfDebug("SQL ERROR (ignored): " . $error . "\n");
} else {
- wfDebug("SQL ERROR: " . mysql_error( $this->mConn ) . "\n");
+ wfDebug("SQL ERROR: " . $error . "\n");
if ( $this->mOut ) {
// this calls wfAbruptExit()
- $this->mOut->databaseError( $fname, $this );
+ $this->mOut->databaseError( $fname, $sql, $error, $errno );
}
}
}
$this->returnToMain(); # Flip back to the main page after 10 seconds.
}
- function databaseError( $fname, &$conn )
+ function databaseError( $fname, $sql, $error, $errno )
{
global $wgUser, $wgCommandLineMode;
$msg = wfMsgNoDB( "dberrortext" );
}
- $msg = str_replace( "$1", htmlspecialchars( $conn->lastQuery() ), $msg );
+ $msg = str_replace( "$1", htmlspecialchars( $sql ), $msg );
$msg = str_replace( "$2", htmlspecialchars( $fname ), $msg );
- $msg = str_replace( "$3", $conn->lastErrno(), $msg );
- $msg = str_replace( "$4", htmlspecialchars( $conn->lastError() ), $msg );
+ $msg = str_replace( "$3", $errno, $msg );
+ $msg = str_replace( "$4", htmlspecialchars( $error ), $msg );
if ( $wgCommandLineMode || !is_object( $wgUser )) {
print "$msg\n";