Mam taki problemik sciągłem skrypt dość rozwinięty bardzo mi się spodobał, ale jest na bazach danych Firebird, nie miałem nigdy do czynienia z nimi i uważam że nie jest mi to potrzebne i dość szybko nie bedzie.
Jest możliwość przerobienia go na Sql
Niby tam jest opcja wyboru Firebird lub mysql ale nie ma class napisanych moze ktoś by mi coś doradził pomógł?
1. //Configuring database connection info fine("DB_DATABASE_PATH", "../"); );
A Klasyy są kilku plikach np:
Firebird.DataAccess.php, FirebirdResultSet.class.php,
Widać ze skrypt napisany pod dwie bazy ale jak ta drugą uruchomić do pomocy dodam to:
Są jakieś klasy mysql zeby mozna było podpiąc
Przykładowa klasa Firebird z skryptu:
/** Connection function * Establishes a connection to Firebird Database. * @Static params (defined in config.php) */ function connect() { if (DB_PERSISTENT_CONNECTION) { $this->connectionLink = ibase_pconnect(DB_HOSTNAME.":".DB_DATABASE_PATH.DB_DATABASE_NAME, DB_USERNAME, DB_PASSWORD) } else { $this->connectionLink = ibase_connect(DB_HOSTNAME.":".DB_DATABASE_PATH.DB_DATABASE_NAME, DB_USERNAME, DB_PASSWORD) } ibase_trans(IBASE_COMMITTED, $this->connectionLink); } /** Disconnect function * Disconnect a active link to DB. * NOTE: if you are using a persistent connection, * that function will not close the connection. * @no params */ function disconnect() { ibase_close($this->connectionLink); } /** Execute function * Executes a prepared query with ibase_prepare * @statement - previous prepared query * @params - collection of params to be replaced in a prepared query. */ function execute($statement, $params = null) { try { //$ret = ibase_execute($statement); $ret = call_user_func('ibase_execute', $statement); } else { $ret = call_user_func_array('ibase_execute', $params); //$ret = ibase_execute($statement, $params); } } catch(Exception $e) { return 'Error on Firebird execute function: '.$e->getMessage()."\n"; } return $ret; } /** SendQuery function * Evaluates a query text before execute. * @query - String containing query text. * @params - collection of params to be replaced in query. */ function & sendQuery($query, $params = null) { if (!self::$connected) { $this->connect(); } $query = ibase_prepare($this->connectionLink, $query); throw new Exception("Input params and query params does not match."); return false; } else { $resultSet = $this->execute($query, $params); if (!$this->isError()) { $myResultSet = new ResultSet(); $i = 0; while(@$line = ibase_fetch_assoc($resultSet)) { foreach($line as $key => $value) { } $i++; } $myResultSet->fetch($array); } else { $myResultSet = new ResultSet(); $myResultSet->setError(ibase_errmsg()); } } return $myResultSet; }
Panie i panowie, za pomoc będe wielkim dłużnikiem bo zalezy mi na tym skrypciku!!!!!!!!!!!!!!!!!!!!