/** * @param String str * @return String */ public function addSlashes($str) { if (useMySQLiLib()) { return mysqli_real_escape_string($this->conn, $str); } return mysql_real_escape_string($str); }
/** * @param String str * @return String */ public function addSlashes($str) { if (useMySQLiLib() && $this->conn) { if ($this->conn) { return mysqli_real_escape_string($this->conn, $str); } } else { // ODBC connection, no MySQL library included return str_replace(array('\\', '\''), array('\\\\', '\\\''), $str); } }
/** * Set the DbInfo object * @param String ODBCString */ protected function setDbInfo($ODBCString) { include_once getabspath("connections/dbinfo/DBInfo.php"); switch ($this->dbType) { case nDATABASE_MySQL: if (useMySQLiLib()) { include_once getabspath("connections/dbinfo/MySQLiInfo.php"); $this->_info = new MySQLiInfo($this); } else { include_once getabspath("connections/dbinfo/MySQLInfo.php"); $this->_info = new MySQLInfo($this); } break; case nDATABASE_Oracle: include_once getabspath("connections/dbinfo/OracleInfo.php"); $this->_info = new OracleInfo($this); break; case nDATABASE_MSSQLServer: include_once getabspath("connections/dbinfo/MSSQLInfo.php"); $this->_info = new MSSQLInfo($this); break; case nDATABASE_Access: if (stripos($ODBCString, 'Provider=') !== false) { include_once getabspath("connections/dbinfo/ADOInfo.php"); $this->_info = new ADOInfo($this); } else { include_once getabspath("connections/dbinfo/ODBCInfo.php"); $this->_info = new ODBCInfo($this); } break; case nDATABASE_PostgreSQL: include_once getabspath("connections/dbinfo/PostgreInfo.php"); $this->_info = new PostgreInfo($this); break; case nDATABASE_Informix: include_once getabspath("connections/dbinfo/InformixInfo.php"); $this->_info = new InformixInfo($this); break; case nDATABASE_SQLite3: include_once getabspath("connections/dbinfo/SQLLite3Info.php"); $this->_info = new SQLLite3Info($this); break; case nDATABASE_DB2: include_once getabspath("connections/dbinfo/DB2Info.php"); $this->_info = new DB2Info($this); } }
/** * @param String connId * @return Connection */ protected function getConnection($connId) { include_once getabspath("connections/Connection.php"); $data = $this->_connectionsData[$connId]; switch ($data["connStringType"]) { case "mysql": if (useMySQLiLib()) { include_once getabspath("connections/MySQLiConnection.php"); return new MySQLiConnection($data); } include_once getabspath("connections/MySQLConnection.php"); return new MySQLConnection($data); case "mssql": case "compact": if (isSqlsrvExtLoaded()) { include_once getabspath("connections/MSSQLSrvConnection.php"); return new MSSQLSrvConnection($data); } if (useMSSQLWinConnect()) { include_once getabspath("connections/MSSQLWinConnection.php"); return new MSSQLWinConnection($data); } include_once getabspath("connections/MSSQLUnixConnection.php"); return new MSSQLUnixConnection($data); case "msaccess": case "odbc": case "odbcdsn": case "custom": case "file": if (stripos($data["ODBCString"], 'Provider=') !== false) { include_once getabspath("connections/ADOConnection.php"); return new ADOConnection($data); } include_once getabspath("connections/ODBCConnection.php"); return new ODBCConnection($data); case "oracle": include_once getabspath("connections/OracleConnection.php"); return new OracleConnection($data); case "postgre": include_once getabspath("connections/PostgreConnection.php"); return new PostgreConnection($data); case "db2": include_once getabspath("connections/DB2Connection.php"); return new DB2Connection($data); case "informix": include_once getabspath("connections/InformixConnection.php"); return new InformixConnection($data); case "sqlite": include_once getabspath("connections/SQLite3Connection.php"); return new SQLite3Connection($data); } }