protected function logStatementError($error,$sql=null) {
		if (!empty($GLOBALS['config']['DB_DEBUG'])) {
			$message = "Error with query - CODE: {$error[1]}";
			if ($sql) {
				$message .= " QUERY: {$sql}";
			}
			$this->getLogger()->error($message);
		}
	}