本文整理汇总了PHP中ibase_connect函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_connect函数的具体用法?PHP ibase_connect怎么用?PHP ibase_connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_connect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: connect
/**
*@package db_firebird
*@method connect()
*@desc Open a connection to a Firebird/Interbase DB
*@since v0.3.1
* */
public static function connect($p_host = NULL, $p_user = NULL, $p_pass = NULL, $p_db = NULL)
{
$H = isset($p_host) ? $p_host : self::$host;
$U = isset($p_user) ? $p_user : self::$user;
$P = isset($p_pass) ? $p_pass : self::$pass;
$D = isset($p_db) ? $p_db : self::$database;
$connection = @ibase_connect($H . ':' . $D, $U, $P);
if ($connection == FALSE) {
try {
throw new FkException("Error al conectar a la db ");
} catch (FkException $e) {
$e->description = 'Firebird/Interbase Respondió:' . ibase_errmsg() . '</b>';
$e->solution = 'Verifique la conexion, posiblemente el archivo /app/config/environment.ini no contiene los datos de conexion correctos. Vea ejemplo:';
$e->solution_code = fk_str_format('[development]
db_host = localhost
db_username = tester
db_password = test
db_name = freekore_dev
db_type = firebird', 'html');
$e->error_code = 'DB000002';
$e->show('code_help');
}
} else {
self::$is_connected = true;
}
}
开发者ID:mmendoza000,项目名称:freekore,代码行数:32,代码来源:db_firebird.php
示例2: connect
public function connect(array $params)
{
$host = $params["host"] . ":" . $params["database"];
$enc = isset($params["charset"]) ? $params["charset"] : null;
$conn = ibase_connect($host, $params["user"], $params["password"], $enc);
return $conn ? $conn : ibase_errmsg();
}
开发者ID:reoring,项目名称:sabel,代码行数:7,代码来源:Driver.php
示例3: connect
public function connect($hostname, $database, $username, $password, $port = 3050)
{
$this->connection = ibase_connect($hostname . "/" . $port . ":" . $database, $username, $password);
if (!$this->connection) {
throw new Exception(ibase_errmsg());
}
}
开发者ID:king52311,项目名称:PHP_Database_Class,代码行数:7,代码来源:Firebird.php
示例4: Open
function Open()
{
$this->link_id = ibase_connect($this->Host, $this->UserName, $this->Password);
if (!$this->link_id) {
$this->ErrorCode = 1;
$this->ErrorMsg = "Host를 연결할 수가 없습니다.";
}
}
开发者ID:AmesianX,项目名称:pilot,代码行数:8,代码来源:interbase.php
示例5: connect
public function connect($config = array())
{
$this->config = $config;
$this->connect = $this->config['pconnect'] === true ? @ibase_pconnect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']) : @ibase_connect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Ibase.php
示例6: connect
/**
* Connects to the database.
*
* This function connects to a ibase database
*
* @param string $host
* @param string $username
* @param string $password
* @param string $db_name
* @return boolean true, if connected, otherwise false
* @access public
* @author Thorsten Rinne <[email protected]>
* @since 2005-04-16
*/
function connect($host, $user, $passwd, $db)
{
$this->conn = ibase_connect($db, $user, $passwd);
if (false == $this->conn) {
PMF_Db::errorPage(ibase_errmsg());
die;
}
return true;
}
开发者ID:noon,项目名称:phpMyFAQ,代码行数:23,代码来源:Ibase.php
示例7: sql_connect
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false)
{
$this->persistency = $persistency;
$this->user = $sqluser;
$this->server = $sqlserver . ($port ? ':' . $port : '');
$this->dbname = $database;
$this->db_connect_id = $this->persistency ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
}
开发者ID:MarxGonzalez,项目名称:SemanticScuttle,代码行数:9,代码来源:firebird.php
示例8: connect
protected function connect()
{
if ($this->lnk === null) {
$this->lnk = $this->settings->persist ? @\ibase_pconnect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset)) : @\ibase_connect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset));
if ($this->lnk === false) {
throw new DatabaseException('Connect error: ' . \ibase_errmsg());
}
}
}
开发者ID:vakata,项目名称:database,代码行数:9,代码来源:Ibase.php
示例9: sql_connect
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
{
$this->persistency = $persistency;
$this->user = $sqluser;
$this->server = $sqlserver . ($port ? ':' . $port : '');
$this->dbname = $database;
$this->db_connect_id = $this->persistency ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
$this->service_handle = function_exists('ibase_service_attach') ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
}
开发者ID:jambik,项目名称:elenaburgon,代码行数:13,代码来源:firebird.php
示例10: Buscar
function Buscar($q)
{
$conn = ibase_connect($this->src, $this->user, $this->password);
$query = "SELECT INVE03.CVE_ART, INVE03.DESCR FROM inve03 where INVE03.DESCR LIKE '%" . $q . "%' AND INVE03.STATUS='A' OR INVE03.CVE_ART LIKE '%" . $q . "%' AND INVE03.STATUS='A' ORDER BY INVE03.CVE_ART";
$inv = ibase_query($conn, $query);
print "<table width='100%' border='0' cellspacing='0' cellpadding='0' style='font-family:Verdana; font-size:10; font-color:#CDCD'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td></td>\n\t\t\t\t</tr>";
while ($IN = ibase_fetch_row($inv)) {
print "<tr>" . "<td>" . $IN[1] . "</td>" . "<td><input style='border:0; background-color: #f9f9f9; font-family:Verdana; font-size:10; font-color:#CDCD; cursor:pointer' type='submit' id='valor2' value='" . $IN[0] . "' onClick='Resultado(\"" . $IN[0] . "\");'/></td>" . "</tr>";
}
print "</table>";
}
开发者ID:kailIII,项目名称:Inventarios-1,代码行数:11,代码来源:findinv.php
示例11: connect
function connect()
{
if ($this->linkId == 0) {
$this->linkId = ibase_connect($this->dbHost . ":" . $this->dbName, $this->dbUser, $this->dbPass, 'ISO8859_1', 0, 3);
if (!$this->linkId) {
$this->updateError('DB::connect()<br />ibase_pconnect');
return false;
}
}
return true;
}
开发者ID:shoaibali,项目名称:ispconfig3,代码行数:11,代码来源:db_firebird.inc.php
示例12: DbSimple_Ibase
/**
* constructor(string $dsn)
* Connect to Interbase/Firebird.
*/
function DbSimple_Ibase($dsn)
{
$p = DbSimple_Generic::parseDSN($dsn);
if (!is_callable('ibase_connect')) {
return $this->_setLastError("-1", "Interbase/Firebird extension is not loaded", "ibase_connect");
}
$ok = $this->link = ibase_connect($p['host'] . (empty($p['port']) ? "" : ":" . $p['port']) . ':' . preg_replace('{^/}s', '', $p['path']), $p['user'], $p['pass'], isset($p['CHARSET']) ? $p['CHARSET'] : 'win1251', isset($p['BUFFERS']) ? $p['BUFFERS'] : 0, isset($p['DIALECT']) ? $p['DIALECT'] : 3, isset($p['ROLE']) ? $p['ROLE'] : '');
$this->_resetLastError();
if (!$ok) {
return $this->_setDbError('ibase_connect()');
}
}
开发者ID:space77,项目名称:mwfv3_sp,代码行数:16,代码来源:Ibase.php
示例13: __construct
/**
* Interbase constructor.
* @param null $database
* @param null $username
* @param null $password
* @param null $charset
* @param null $buffers
* @param null $dialect
* @param null $role
* @param null $sync
*/
public function __construct($database = null, $username = null, $password = null, $charset = null, $buffers = null, $dialect = null, $role = null, $sync = null)
{
$this->database = $database;
$this->username = $username;
$this->password = $password;
$this->charset = $charset;
$this->buffers = $buffers;
$this->dialect = $dialect;
$this->role = $role;
$this->sync = $sync;
$this->resource = ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
}
开发者ID:universaldb,项目名称:ibase,代码行数:23,代码来源:Interbase.php
示例14: connect
function connect($server, $username, $password)
{
$this->_link = ibase_connect($server, $username, $password);
if ($this->_link) {
$url_parts = explode(':', $server);
$this->service_link = ibase_service_attach($url_parts[0], $username, $password);
$this->server_info = ibase_server_info($this->service_link, IBASE_SVC_SERVER_VERSION);
} else {
$this->errno = ibase_errcode();
$this->error = ibase_errmsg();
}
return (bool) $this->_link;
}
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:13,代码来源:firebird.inc.php
示例15: connect
/**
* @see ILumine_Connection::connect()
*/
public function connect()
{
if ($this->conn_id && $this->state == self::OPEN) {
Lumine_Log::debug('Utilizando conexao cacheada com ' . $this->getDatabase());
return true;
}
$this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::PRE_CONNECT, $this));
$hostString = $this->getHost();
if ($this->getPort() != '') {
// nao colocamos a porta uma vez que a string de conexao
// nao suporta a informacao da porta
//$hostString .= ':' . $this->getPort();
}
$hostString = empty($hostString) ? $this->getDatabase() : $hostString . ':' . $this->getDatabase();
if (isset($this->options['socket']) && $this->options['socket'] != '') {
$hostString .= ':' . $this->options['socket'];
}
$flags = isset($this->options['flags']) ? $this->options['flags'] : null;
if (isset($this->options['persistent']) && $this->options['persistent'] == true) {
Lumine_Log::debug('Criando conexao persistente com ' . $this->getDatabase());
$this->conn_id = @ibase_pconnect($hostString, $this->getUser(), $this->getPassword());
} else {
Lumine_Log::debug('Criando conexao com ' . $this->getDatabase());
$this->conn_id = @ibase_connect($hostString, $this->getUser(), $this->getPassword());
}
if (!$this->conn_id) {
$this->state = self::CLOSED;
$msg = 'Nao foi possivel conectar no banco de dados: ' . $this->getDatabase() . ' - ' . $this->getErrorMsg();
Lumine_Log::error($msg);
$this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::CONNECTION_ERROR, $this, $msg));
throw new Exception($msg);
return false;
}
if (function_exists('ibase_timefmt')) {
ibase_timefmt($this->ibase_datefmt, IBASE_DATE);
if ($this->dialect == 1) {
ibase_timefmt($this->ibase_datefmt, IBASE_TIMESTAMP);
} else {
ibase_timefmt($this->ibase_timestampfmt, IBASE_TIMESTAMP);
}
ibase_timefmt($this->ibase_timefmt, IBASE_TIME);
} else {
ini_set("ibase.timestampformat", $this->ibase_timestampfmt);
ini_set("ibase.dateformat", $this->ibase_datefmt);
ini_set("ibase.timeformat", $this->ibase_timefmt);
}
$this->state = self::OPEN;
$this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::POS_CONNECT, $this));
$this->setCharset($this->getCharset());
return true;
}
开发者ID:rrmoura1,项目名称:Abstergo,代码行数:54,代码来源:Firebird.php
示例16: openConnection
public function openConnection()
{
$database = "{$this->firebird->host}/{$this->account->firebird->port}:{$this->path->path}{$this->firebird->dir}{$this->account->idAccount}/{$this->account->idAccount}.FDB";
//die($database);
//$database = "{$this->firebird->host}{$this->path->path}{$this->firebird->dir}{$this->account->idAccount}/{$this->account->idAccount}.FDB";
//print($database); die();
//$database="190.147.164.82/8080:/home/silar/app/databases/{$this->account->idAccount}/{$this->account->idAccount}.FDB";
$this->logger->log("Database: {$database}");
$this->logger->log("Username: {$this->firebird->username}");
$this->logger->log("Password: {$this->firebird->password}");
//die($database);
$this->connection = \ibase_connect($database, $this->firebird->username, $this->firebird->password);
if (!$this->connection) {
throw new \Exception("Acceso denegado");
}
}
开发者ID:solutionsCluster,项目名称:silar,代码行数:16,代码来源:FirebirdConnector.php
示例17: db_connect
function db_connect()
{
$hostname = 'localhost';
$dialect = 3;
$char_set = 'NONE';
if (strcmp(trim($this->hostname), "") != 0) {
$hostname = $this->hostname;
}
if (isset($this->dialect) && $this->dialect == 1) {
$dialect = $this->dialect;
}
if (strcmp(trim($this->char_set), "") != 0) {
$char_set = $this->char_set;
}
$dbpath = $hostname . ":" . $this->database;
return @ibase_connect($dbpath, $this->username, $this->password, $char_set, 0, $dialect);
}
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:17,代码来源:ibase_driver.php
示例18: DBAQuery
function DBAQuery(&$db, $database_file, $query)
{
if (!function_exists("ibase_connect")) {
return $db->SetError("DBA query", "Interbase support is not available in this PHP configuration");
}
if (!isset($db->options[$option = "DBAUser"]) || !isset($db->options[$option = "DBAPassword"])) {
return $db->SetError("DBA query", "it was not specified the Interbase {$option} option");
}
$database = $db->host . (strcmp($database_file, "") ? ":" . $database_file : "");
if (($connection = @ibase_connect($database, $db->options["DBAUser"], $db->options["DBAPassword"])) <= 0) {
return $db->SetError("DBA query", "Could not connect to Interbase server ({$database}): " . ibase_errmsg());
}
if (!($success = @ibase_query($connection, $query))) {
$db->SetError("DBA query", "Could not execute query ({$query}): " . ibase_errmsg());
}
ibase_close($connection);
return $success;
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:18,代码来源:manager_ibase.php
示例19: connect
/**
* Connects to a database.
* @return void
* @throws Dibi\Exception
*/
public function connect(array &$config)
{
Dibi\Helpers::alias($config, 'database', 'db');
if (isset($config['resource'])) {
$this->connection = $config['resource'];
} else {
// default values
$config += ['username' => ini_get('ibase.default_password'), 'password' => ini_get('ibase.default_user'), 'database' => ini_get('ibase.default_db'), 'charset' => ini_get('ibase.default_charset'), 'buffers' => 0];
if (empty($config['persistent'])) {
$this->connection = @ibase_connect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
// intentionally @
} else {
$this->connection = @ibase_pconnect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
// intentionally @
}
if (!is_resource($this->connection)) {
throw new Dibi\DriverException(ibase_errmsg(), ibase_errcode());
}
}
}
开发者ID:dg,项目名称:dibi,代码行数:25,代码来源:FirebirdDriver.php
示例20: sql_connect
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
{
$this->persistency = $persistency;
$this->user = $sqluser;
$this->server = $sqlserver . ($port ? ':' . $port : '');
$this->dbname = str_replace('\\', '/', $database);
// There are three possibilities to connect to an interbase db
if (!$this->server) {
$use_database = $this->dbname;
} else {
if (strpos($this->server, '//') === 0) {
$use_database = $this->server . $this->dbname;
} else {
$use_database = $this->server . ':' . $this->dbname;
}
}
$this->db_connect_id = $this->persistency ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
$this->service_handle = function_exists('ibase_service_attach') && $this->server ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
}
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:23,代码来源:firebird.php
注:本文中的ibase_connect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论