本文整理汇总了PHP中ibase_free_result函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_free_result函数的具体用法?PHP ibase_free_result怎么用?PHP ibase_free_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_free_result函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($sql, $bindParams = array(), $additionalParameters = array())
{
$connection = $this->connection;
if (empty($bindParams)) {
$result = ibase_query($connection, $sql);
} else {
$holderRegex = "/@[a-zA-Z0-9_]+@/";
preg_match_all($holderRegex, $sql, $matches);
$args = array($connection, preg_replace($holderRegex, "?", $sql));
foreach ($matches[0] as $holder) {
$args[] = $bindParams[$holder];
}
$result = call_user_func_array("ibase_query", $args);
}
if (!$result) {
$this->executeError($sql);
}
$rows = array();
if (is_resource($result)) {
while ($row = ibase_fetch_assoc($result, IBASE_TEXT)) {
$rows[] = array_change_key_case($row);
}
ibase_free_result($result);
} else {
$this->affectedRows = $result === true ? 0 : $result;
}
if ($this->autoCommit) {
ibase_commit($connection);
}
return empty($rows) ? null : $rows;
}
开发者ID:reoring,项目名称:sabel,代码行数:31,代码来源:Driver.php
示例2: close
/**
* Close resultset and free result memory
*
* @return bool success
*/
public function close()
{
if (!$this->handle) {
return;
}
$r = ibase_free_result($this->handle);
$this->handle = NULL;
return $r;
}
开发者ID:melogamepay,项目名称:xp-framework,代码行数:14,代码来源:InterBaseResultSet.class.php
示例3: free
/**
* This function frees the command reference.
*
* @access public
* @override
*/
public function free()
{
if ($this->command !== NULL) {
@ibase_free_result($this->command);
$this->command = NULL;
$this->record = FALSE;
$this->blobs = array();
$this->resource = NULL;
}
}
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:16,代码来源:Standard.php
示例4: closeCursor
/**
* Closes the cursor, allowing the statement to be executed again.
*
* @return bool
*/
public function closeCursor()
{
if ($stmt = $this->_stmtResult) {
return @ibase_free_result($this->_stmtResult);
}
return false;
}
开发者ID:JosefinaArayaTapia,项目名称:Capicua-Restobar,代码行数:12,代码来源:Firebird_3.php
示例5: close
/**
+----------------------------------------------------------
* 关闭数据库
+----------------------------------------------------------
* @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;
}
开发者ID:dalinhuang,项目名称:concourse,代码行数:19,代码来源:DbIbase.class.php
示例6: form33
function form33($orders, $dbh, $crd)
{
$curdate = date("m.d.Y");
$ordersid = "";
$n = count($orders);
for ($i = 1; $i < $n; $i++) {
$ordersid .= $orders[$i];
if ($i != $n - 1) {
$ordersid .= ",";
}
}
$results = "";
$stmt = "select p.panel, o.id from orders o inner join panels p on p.id = o.panelid where o.status in ('O','E') and o.id in (" . $ordersid . ") ";
$result = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_row($result)) {
$restm = "select count(*) from ordtask where ordersid = " . $row[1] . " and apprsts = 'T' ";
$res = ibase_query($dbh, $restm);
$n = ibase_fetch_row($res);
$n = $n[0];
ibase_free_result($res);
if ($n == 1) {
$restm = "select a.analyte, case a.analtype when 3 then replace(r.finalresult,'.',',') else r.finalresult end, u.short, r.charlimits, r.status from results r inner join units u on u.id = r.unit inner join analytes a on a.id = r.analyteid inner join ordtask ord on ord.id = r.ordtaskid where ord.ordersid = " . $row[1] . " and finalresult is not null ";
$res = ibase_query($dbh, $restm);
$row = ibase_fetch_row($res);
$ress = $row[1];
if ($row[4] == "O") {
$ress = "\\textbf{" . $row[1] . "}";
}
$results .= "\\textbf{" . $row[0] . "} & " . $ress . " & " . $row[2] . " \\\\ \n";
$results .= "\\hline" . "\n";
ibase_free_result($res);
} else {
$results .= "\\textbf{" . $row[0] . "} & & \\\\ \n\\hline \n";
$restm = "select a.analyte, case a.analtype when 3 then replace(r.finalresult,'.',',') else r.finalresult end, coalesce(u.short, ' '), coalesce(r.charlimits, ' '), r.status from results r inner join units u on u.id = r.unit inner join analytes a on a.id = r.analyteid inner join ordtask ord on ord.id = r.ordtaskid where ord.ordersid = " . $row[1] . " and finalresult is not null order by a.analyte";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$unit = $row[2];
//$unit = str_replace('%','\\%',$row[2]);
//$unit = str_replace('^','\\^{}',$unit);
$charlimits = str_replace('%', '\\%', $row[3]);
$charlimits = str_replace('^', '\\^{}', $charlimits);
$ress = $row[1];
if ($row[4] == "O") {
$ress = "\\textbf{" . $row[1] . "}";
}
$results .= "~ " . $row[0] . " & " . $ress . " & " . $unit . " \\\\ \n";
$results .= "\\hline" . "\n";
}
ibase_free_result($res);
}
}
$user = "";
$restm = "select distinct coalesce(u.fullname, '') from users u inner join results r on r.usernam = u.usernam inner join ordtask o on o.id = r.ordtaskid inner join orders ord on ord.id = o.ordersid where ord.id in (" . $ordersid . ") ";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$user .= $row[0];
}
ibase_free_result($res);
$appruser = "";
$restm = "select distinct u.fullname from ordtask o inner join users u on u.usernam = o.appruser where o.ordersid in(" . $ordersid . ")";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$appruser .= $row[0];
}
ibase_free_result($res);
$comments = "";
$restm = "select distinct f.comments from foldercomments f inner join orders o on o.folderno = f.folderno where o.id in(" . $ordersid . ") and f.flag = 'Y' order by f.id";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$comments .= "\\small \\quad " . $row[0] . "\n\n";
}
ibase_free_result($res);
$biomat = find_biomat($ordersid, $dbh);
$head = "\\vspace{-10px} \\flushleft \\normalsize Биоматериал: " . $biomat . "\n\n\\vspace{3px}";
$head .= "\n\\begin{longtable}[h]{|m{290px}|>{\\centering\\arraybackslash}p{100px}|m{60px}|}\n\\hline\nНазвание испытания & Результат & Единицы измерения \\\\\n\\hline";
$end = "\\end{longtable}\n\\vspace{-15px}\n\\flushleft Интерпретация классов: 0 - антитела не обнаружены; 1 - низкий уровень антител; 2 - средний уровень антител; 3 - высокий уровень антител; 4 и выше - очень высокий уровень антител";
$apprdate = find_apprdate($ordersid, $dbh);
//$end .= $apprdate;
$end .= "\n\\vspace{-4px}\n\\flushleft Комментарии:" . $comments . "\n\\flushleft Исследования проводил: " . $user . " \n\\vspace{-4px}\n\\flushleft Выпускающий врач: " . $appruser . " \n\\newline\n\\flushright Дата выдачи: " . $apprdate;
return $head . $results . $end;
}
开发者ID:KhasanOrsaev,项目名称:work_nacpp,代码行数:81,代码来源:form33.php
示例7: dbi_free_result
/**
* Frees a result set.
*
* @param resource $res The database query resource returned from
* the {@link dbi_query()} function.
*
* @return bool True on success
*/
function dbi_free_result($res)
{
if (strcmp($GLOBALS["db_type"], "mysql") == 0) {
return mysql_free_result($res);
} else {
if (strcmp($GLOBALS["db_type"], "mysqli") == 0) {
return mysqli_free_result($res);
} else {
if (strcmp($GLOBALS["db_type"], "mssql") == 0) {
return mssql_free_result($res);
} else {
if (strcmp($GLOBALS["db_type"], "oracle") == 0) {
// Not supported. Ingore.
if ($GLOBALS["oracle_statement"] >= 0) {
OCIFreeStatement($GLOBALS["oracle_statement"]);
$GLOBALS["oracle_statement"] = -1;
}
} else {
if (strcmp($GLOBALS["db_type"], "postgresql") == 0) {
return pg_freeresult($res);
} else {
if (strcmp($GLOBALS["db_type"], "odbc") == 0) {
return odbc_free_result($res);
} else {
if (strcmp($GLOBALS["db_type"], "ibm_db2") == 0) {
return db2_free_result($res);
} else {
if (strcmp($GLOBALS["db_type"], "ibase") == 0) {
return ibase_free_result($res);
} else {
dbi_fatal_error("dbi_free_result(): db_type not defined.");
}
}
}
}
}
}
}
}
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:48,代码来源:php-dbi.php
示例8: _close
function _close()
{
return @ibase_free_result($this->_queryID);
}
开发者ID:kractos26,项目名称:orfeo,代码行数:4,代码来源:adodb-ibase.inc.php
示例9: tableInfo
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @ibase_query($this->connection, "SELECT * FROM {$result} WHERE 1=0");
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
if (!is_resource($id)) {
return $this->ibaseRaiseError(DB_ERROR_NEED_MORE_DATA);
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
$count = @ibase_num_fields($id);
$res = array();
if ($mode) {
$res['num_fields'] = $count;
}
for ($i = 0; $i < $count; $i++) {
$info = @ibase_field_info($id, $i);
$res[$i] = array('table' => $got_string ? $case_func($result) : '', 'name' => $case_func($info['name']), 'type' => $info['type'], 'len' => $info['length'], 'flags' => $got_string ? $this->_ibaseFieldFlags($info['name'], $result) : '');
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
// free the result only if we were called on a table
if ($got_string) {
@ibase_free_result($id);
}
return $res;
}
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:72,代码来源:ibase.php
示例10: FreeResult
function FreeResult($result)
{
$result_value = intval($result);
if (!isset($this->current_row[$result_value])) {
return $this->SetError("Free result", "attemped to free an unknown query result");
}
unset($this->highest_fetched_row[$result_value]);
unset($this->row_buffer[$result_value]);
unset($this->limits[$result_value]);
unset($this->current_row[$result_value]);
unset($this->results[$result_value]);
unset($this->columns[$result_value]);
unset($this->rows[$result_value]);
unset($this->result_types[$result]);
return ibase_free_result($result);
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:16,代码来源:metabase_ibase.php
示例11: __destruct
function __destruct()
{
ibase_free_result($this->_result);
}
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:4,代码来源:firebird.inc.php
示例12: form30
function form30($orders, $dbh, $crd)
{
$curdate = date("m.d.Y");
$ordersid = "";
$n = count($orders);
for ($i = 1; $i < $n; $i++) {
$ordersid .= $orders[$i];
if ($i != $n - 1) {
$ordersid .= ",";
}
}
$results = "";
$stmt = "select t.testname, t.id, o.id from ordtask o inner join tests t on t.id = o.testcode inner join orders ord on ord.id = o.ordersid inner join panels p on p.id = ord.panelid where ord.id in (" . $ordersid . ") order by p.priority ";
$result = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_row($result)) {
$restm = "select count(*) from results where ordtaskid = " . $row[2] . " and finalresult is not null and status in ('O','E') and show = 'Y'";
$res = ibase_query($dbh, $restm);
$n = ibase_fetch_row($res);
$n = $n[0];
ibase_free_result($res);
if ($n == 1) {
$restm = "select a.analyte, case a.analtype when 3 then replace(r.finalresult,'.',',') else coalesce(pos.inreport, r.finalresult) end, u.short, r.charlimits, r.status from results r left join units u on u.id = r.unit inner join analytes a on a.id = r.analyteid left join possibleresults pos on pos.analyte = r.analyteid and r.rawresult = pos.result where r.ordtaskid = " . $row[2] . " and finalresult is not null order by a.sorter ";
$res = ibase_query($dbh, $restm);
$row = ibase_fetch_row($res);
$ress = $row[1];
if ($row[4] == "O") {
$ress = "\\textbf{" . $row[1] . "}";
}
$row[0] = str_replace('%', '\\%', $row[0]);
$row[0] = str_replace('β', '$\\beta$', $row[0]);
$results .= "\\textbf{" . $row[0] . "} & " . $ress . " & " . $row[2] . " & " . $row[3] . " \\\\ \n";
$results .= "\\hline" . "\n";
ibase_free_result($res);
} else {
$row[0] = str_replace('%', '\\%', $row[0]);
$row[0] = str_replace('β', '$\\beta$', $row[0]);
$results .= "\\textbf{" . $row[0] . "} & & & \\\\ \n\\hline \n";
$restm = "select a.analyte, case a.analtype when 3 then replace(r.finalresult,'.',',') else coalesce(pos.inreport, r.finalresult) end, coalesce(u.short, ' '), coalesce(r.charlimits, ' '), r.status from results r left join units u on u.id = r.unit inner join analytes a on a.id = r.analyteid left join possibleresults pos on pos.analyte = r.analyteid and pos.result = r.rawresult where r.ordtaskid = " . $row[2] . " and finalresult is not null order by a.sorter";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$unit = $row[2];
//$unit = str_replace('%','\\%',$row[2]);
//$unit = str_replace('^','\\^{}',$unit);
$charlimits = str_replace('%', '\\%', $row[3]);
$charlimits = str_replace('^', '\\^{}', $charlimits);
$ress = $row[1];
if ($row[4] == "O") {
$ress = "\\textbf{" . $row[1] . "}";
}
$results .= "~ \\footnotesize " . $row[0] . " & \\footnotesize " . $ress . " & \\footnotesize " . $unit . " & \\footnotesize " . $charlimits . " \\\\ \n";
$results .= "\\hline" . "\n";
}
ibase_free_result($res);
}
}
$user = "";
$restm = "select distinct coalesce(u.fullname, '') from users u inner join results r on r.usernam = u.usernam inner join ordtask o on o.id = r.ordtaskid inner join orders ord on ord.id = o.ordersid where ord.id in (" . $ordersid . ") ";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$user .= $row[0];
}
ibase_free_result($res);
$appruser = "";
$restm = "select distinct u.fullname from ordtask o inner join users u on u.usernam = o.appruser where o.ordersid in(" . $ordersid . ")";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$appruser .= $row[0] . " ";
}
ibase_free_result($res);
$comments = "";
$restm = "select distinct f.comments from foldercomments f inner join orders o on o.folderno = f.folderno where o.id in(" . $ordersid . ") and f.flag = 'Y' order by f.id";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$comments .= "\\small \\quad " . $row[0] . "\n\n";
}
ibase_free_result($res);
$biomat = find_biomat($ordersid, $dbh);
$panelname = find_panel($ordersid, $dbh);
$head = "\\vspace{-10px} \\flushleft \\normalsize Биоматериал: " . $biomat . "\n\n\\vspace{3px}";
$head .= "\n\n\\vspace{1px}";
$head .= "\\begin{center} ";
$head .= "\\textbf{" . $panelname . "}\\end{center} \n\n\\vspace{-5px}";
$head .= "\n\\begin{longtable}[h]{|m{160px}|>{\\centering\\arraybackslash}p{100px}|m{60px}|m{112px}|}\n\\hline\nИсследование & Результат & Единицы \\newline измерения & Референты \\\\\n\\hline";
$apprdate = find_apprdate($ordersid, $dbh);
$comments = str_replace('%', '\\%', $comments);
$end = "\\end{longtable}\n\\vspace{-15px}\n\\flushleft Комментарии:" . $comments . "\n\\vspace{-4px}\n\\flushleft Исследования проводил: " . $user . " \n\\vspace{-4px}\n\\flushleft Выпускающий врач: " . $appruser . " \n\\newline\n\\flushright Дата выдачи: " . $apprdate;
return $head . $results . $end;
}
开发者ID:KhasanOrsaev,项目名称:work_nacpp,代码行数:88,代码来源:form32.php
示例13: tableInfo
/**
* Returns information about a table or a result set
*
* NOTE: doesn't support 'flags'and 'table' if called from a db_result
*
* @param mixed $resource Interbase result identifier or table name
* @param int $mode A valid tableInfo mode (DB_TABLEINFO_ORDERTABLE or
* DB_TABLEINFO_ORDER)
*
* @return array An array with all the information
*/
function tableInfo($result, $mode = null)
{
$count = 0;
$id = 0;
$res = array();
/*
* depending on $mode, metadata returns the following values:
*
* - mode is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
*
* - mode is DB_TABLEINFO_ORDER
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags
* ["order"][field name] index of field named "field name"
* The last one is used, if you have a field name, but no index.
* Test: if (isset($result['meta']['myfield'])) { ...
*
* - mode is DB_TABLEINFO_ORDERTABLE
* the same as above. but additionally
* ["ordertable"][table name][field name] index of field
* named "field name"
*
* this is, because if you have fields from different
* tables with the same field name * they override each
* other with DB_TABLEINFO_ORDER
*
* you can combine DB_TABLEINFO_ORDER and
* DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER |
* DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL
*/
// if $result is a string, then we want information about a
// table without a resultset
if (is_string($result)) {
$id = ibase_query($this->connection, "SELECT * FROM {$result}");
if (empty($id)) {
return $this->ibaseRaiseError();
}
} else {
// else we want information about a resultset
$id = $result;
if (empty($id)) {
return $this->ibaseRaiseError();
}
}
$count = @ibase_num_fields($id);
// made this IF due to performance (one if is faster than $count if's)
if (empty($mode)) {
for ($i = 0; $i < $count; $i++) {
$info = @ibase_field_info($id, $i);
$res[$i]['table'] = is_string($result) ? $result : '';
$res[$i]['name'] = $info['name'];
$res[$i]['type'] = $info['type'];
$res[$i]['len'] = $info['length'];
$res[$i]['flags'] = is_string($result) ? $this->_ibaseFieldFlags($info['name'], $result) : '';
}
} else {
// full
$res["num_fields"] = $count;
for ($i = 0; $i < $count; $i++) {
$info = @ibase_field_info($id, $i);
$res[$i]['table'] = is_string($result) ? $result : '';
$res[$i]['name'] = $info['name'];
$res[$i]['type'] = $info['type'];
$res[$i]['len'] = $info['length'];
$res[$i]['flags'] = is_string($result) ? $this->_ibaseFieldFlags($info['name'], $result) : '';
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
}
// free the result only if we were called on a table
if (is_string($result)) {
ibase_free_result($id);
}
return $res;
//.........这里部分代码省略.........
开发者ID:amjadtbssm,项目名称:website,代码行数:101,代码来源:ibase.php
示例14: _ibaseFieldFlags
/**
* get the Flags of a Field
*
* @param string $field_name the name of the field
* @param string $table_name the name of the table
*
* @return string The flags of the field ("primary_key", "unique_key", "not_null"
* "default", "computed" and "blob" are supported)
* @access private
*/
function _ibaseFieldFlags($field_name, $table_name)
{
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$sql = 'SELECT R.RDB$CONSTRAINT_TYPE CTYPE' . ' FROM RDB$INDEX_SEGMENTS I' . ' JOIN RDB$RELATION_CONSTRAINTS R ON I.RDB$INDEX_NAME=R.RDB$INDEX_NAME' . ' WHERE I.RDB$FIELD_NAME=\'' . $field_name . '\'' . ' AND UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'';
$result = @ibase_query($db->connection, $sql);
if (!$result) {
return $db->raiseError();
}
$flags = '';
if ($obj = @ibase_fetch_object($result)) {
@ibase_free_result($result);
if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'PRIMARY KEY') {
$flags .= 'primary_key ';
}
if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'UNIQUE') {
$flags .= 'unique_key ';
}
}
$sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,' . ' R.RDB$DEFAULT_SOURCE AS DSOURCE,' . ' F.RDB$FIELD_TYPE AS FTYPE,' . ' F.RDB$COMPUTED_SOURCE AS CSOURCE' . ' FROM RDB$RELATION_FIELDS R ' . ' JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME' . ' WHERE UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'' . ' AND R.RDB$FIELD_NAME=\'' . $field_name . '\'';
$result = @ibase_query($db->connection, $sql);
if (!$result) {
return $db->raiseError();
}
if ($obj = @ibase_fetch_object($result)) {
@ibase_free_result($result);
if (isset($obj->NFLAG)) {
$flags .= 'not_null ';
}
if (isset($obj->DSOURCE)) {
$flags .= 'default ';
}
if (isset($obj->CSOURCE)) {
$flags .= 'computed ';
}
if (isset($obj->FTYPE) && $obj->FTYPE == 261) {
$flags .= 'blob ';
}
}
return trim($flags);
}
开发者ID:BackupTheBerlios,项目名称:smart-svn,代码行数:50,代码来源:ibase.php
示例15: ibase_connect
<?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);
开发者ID:exakat,项目名称:exakat,代码行数:11,代码来源:Extibase.01.php
示例16: free
/**
* Free the internal resources associated with $result.
*
* @return boolean true on success, false if $result is invalid
* @access public
*/
function free()
{
if (is_resource($this->result) && $this->db->connection) {
$free = @ibase_free_result($this->result);
if (false === $free) {
return $this->db->raiseError(null, null, null, 'Could not free result', __FUNCTION__);
}
}
$this->result = false;
return MDB2_OK;
}
开发者ID:Dulciane,项目名称:jaws,代码行数:17,代码来源:ibase.php
示例17: OpenPage
function OpenPage($SQL, $PageSize, $Page)
{
$this->SQL = $SQL;
$this->Page = $Page;
$this->PageSize = $PageSize;
// 레코드 카운트를 얻어온다.
$SQL = str_replace("@First", "1", $this->SQL);
$SQL = str_replace("@Skip", "0", $SQL);
$SQL = str_replace("@SelectField", "Count(*)", $SQL);
$this->Records = ibase_query($SQL, $this->Database->link_id);
$this->Record = ibase_fetch_row($this->Records);
$this->RecordCount = $this->Record[0];
ibase_free_result($this->Records);
// 레코드가 없음
if (!$this->RecordCount) {
$this->RecordCount = 0;
$this->FieldCount = 0;
$this->RecNo = 0;
$this->RecNoDesc = 0;
$this->EOF = 1;
return false;
}
$this->RecNo = $PageSize * ($Page - 1) + 1;
$this->RecNoDesc = $this->RecordCount - $PageSize * ($Page - 1);
$this->LastPage = intval(($this->RecordCount - 1) / $PageSize) + 1;
// Select할 필드를 치환한 후 오픈한다.
$SQL = str_replace("@First", $PageSize, $this->SQL);
$SQL = str_replace("@Skip", $PageSize * ($Page - 1), $SQL);
$SQL = str_replace("@SelectField", $this->SelectField, $SQL);
$this->Records = ibase_query($SQL, $this->Database->link_id);
$this->FieldCount = ibase_num_fields($this->Records);
unset($this->Fields);
for ($i = 0; $i < $this->FieldCount; $i++) {
$this->Fields[] = $this->FieldName($i);
}
$this->Record = ibase_fetch_row($this->Records);
if ($this->Record) {
$this->EOF = 0;
} else {
$this->EOF = 1;
}
}
开发者ID:AmesianX,项目名称:pilot,代码行数:42,代码来源:interbase.php
示例18: otherdb
//.........这里部分代码省略.........
<select onchange="return fbFull(options[selectedIndex].value)">
\t<option value="0" selected>command</option>
<option value="1">tables</option>
<option value="2">columns</option>
<option value="3">import sql</option>
<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">';
echo '<table border="1" cellpadding="1" cellspacing="2">';
echo "\n<tr>\n";
for ($i = 0; $i < ibase_num_fields($fbresult); $i++) {
echo '<td bgcolor="#228B22"><b>' . ibase_field_info($fbresult, $i);
echo "</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 bgcolor="#B8B8E8">';
echo "{$fbrow[$i]}";
echo '</td>';
}
echo "</tr>\n";
}
echo "</table>\n";
echo "</font>";
ibase_free_result($fbresult);
ibase_close();
}
} else {
$pghost = isset($_POST['pghost']) ? $_POST['pghost'] : 'localhost';
$pguser = isset($_POST['pguser']) ? $_POST['pguser'] : 'postgres';
$pgpass = isset($_POST['pgpass']) ? $_POST['pgpass'] : '';
$pgdbname = isset($_POST['pgdbname']) ? $_POST['pgdbname'] : 'postgres';
$pgaction = isset($_POST['action']) ? $_POST['action'] : '';
$pgquery = isset($_POST['pgsql']) ? $_POST['pgsql'] : '';
$pgquery = stripslashes($pgquery);
print <<<END
<form method="POST" name="pgform" action="?s=w">
<div class="actall">Host:<input type="text" name="pghost" value="{$pghost}" style="width:100px;">
User:<input type="text" name="pguser" vaule="{$pguser}" style="width:100px">
Pass:<input tyoe="text" name="pgpass" value="{$pgpass}" style="width:100px">
Dbname:<input type="text" name="pgdbname" value="{$pgdbname}" style="width:100px"><br><br>
<script language="javascript">
function pgFull(i){
\tStr = new Array(7);
\tStr[0] = "";
Str[1] = "select version();";
Str[2] = "select datname from pg_database;";
Str[3] = "select relname from pg_stat_user_tables limit 1 offset n;";
Str[4] = "select column_name from information_schema.columns where table_name='xxx' limit 1 offset n;";
Str[5] = "select usename,passwd from pg_shadow;";
\tStr[6] = "select pg_file_read('pg_hba.conf',1,pg_file_length('pg_hb.conf'));";
\tpgform.pgsql.value = Str[i];
\treturn true;
}
</script>
<textarea name="pgsql" style="width:600px;height:200px;">{$pgquery}</textarea><br>
<select onchange="return pgFull(options[selectedIndex].value)">
开发者ID:mcanv,项目名称:webshell,代码行数:67,代码来源:r00ts+php大马.php
示例19: free_result
/**
* Free the result
*
* @return void
*/
public function free_result()
{
ibase_free_result($this->result_id);
}
开发者ID:sacsand,项目名称:abcd,代码行数:9,代码来源:ibase_result.php
示例20: GetData
function GetData($_start = 0, $_count = 9999999)
{
//Return associate array of data
$_tpl_select_command = "SELECT {limit} * FROM ({SelectCommand}) {where} {orderby} {groupby}";
//Filters
$_where = "";
$_filters = $this->Filters;
for ($i = 0; $i < sizeof($_filters); $i++) {
$_where .= " and " . $this->GetFilterExpression($_filters[$i]);
}
if ($_where != "") {
$_where = "WHERE " . substr($_where, 5);
}
//Order
$_orderby = "";
$_orders = $this->Sorts;
for ($i = 0; $i < sizeof($_orders); $i++) {
$_orderby .= ", " . $_orders[$i]->Field . " " . $_orders[$i]->Order;
}
if ($_orderby != "") {
$_orderby = "ORDER BY " . substr($_orderby, 2);
}
//Group
$_groupby = "";
$_groups = $this->Groups;
for ($i = 0; $i < sizeof($_groups); $i++) {
$_groupby .= ", " . $_groups[$i]->Field;
}
if ($_groupby != "") {
$_groupby = "GROUP BY " . substr($_groupby, 2);
}
//Limit
$_limit = "FIRST " . $_count . " SKIP " . $_start;
$_select_command = str_replace("{SelectCommand}", $this->SelectCommand, $_tpl_select_command);
$_select_command = str_replace("{where}", $_where, $_select_command);
$_select_command = str_replace("{orderby}", $_orderby, $_select_command);
$_select_command = str_replace("{groupby}", $_groupby, $_select_command);
$_select_command = str_replace("{limit}", $_limit, $_select_command);
//echo $_select_command;
$_result = ibase_query($this->_Link, $_select_command);
$_rows = array();
while ($_row = ibase_fetch_assoc($_result)) {
array_push($_rows, $_row);
}
ibase_free_result($_result);
return $_rows;
}
开发者ID:skydel,项目名称:universal-online-exam,代码行数:47,代码来源:FirebirdDataSource.php
注:本文中的ibase_free_result函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论