本文整理汇总了PHP中ibase_fetch_assoc函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_fetch_assoc函数的具体用法?PHP ibase_fetch_assoc怎么用?PHP ibase_fetch_assoc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_fetch_assoc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getModelConfigImposto
public function getModelConfigImposto($id){
$sql = "SELECT
CONFIG_IMPOSTO_ID,
NOME_TABELA,
COALESCE(ISS,0) AS ISS,
COALESCE(INSS,0) AS INSS,
COALESCE(PIS,0) AS PIS,
COALESCE(COFINS,0) AS COFINS,
COALESCE(CSLL,0) AS CSLL,
COALESCE(IRPJ,0) AS IRPJ,
COALESCE(RETENCAO_FONTE,'N') AS RETENCAO_FONTE
FROM CONFIG_IMPOSTO
WHERE CONFIG_IMPOSTO.CONFIG_IMPOSTO_ID =".$id;
$rs = parent::execute_query($sql);
while($row = ibase_fetch_assoc($rs)){
$this->CONFIG_IMPOSTO_ID = $row['CONFIG_IMPOSTO_ID'];
$this->NOME_TABELA = $row['NOME_TABELA'];
$this->ISS = $row['ISS'];
$this->PIS = $row['PIS'];
$this->INSS= $row['INSS'];
$this->COFINS = $row['COFINS'];
$this->CSll = $row['CSLL'];
$this->IRPJ = $row['IRPJ'];
$this->RENTENCAO_FONTE = $row['RETENCAO_FONTE'];
$this->SYNC = $rs['SYNC'];
}
return $this;
}
示例2: FetchAs
function FetchAs($result)
{
if (!is_resource($result)) {
return false;
}
return ibase_fetch_assoc($result);
}
示例3: 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;
}
示例4: select_sql
function select_sql($sql)
{ $j=1;
$Row=array(array());
$this->sql_connect();
$this->sql_query=$sql;
$this->sql_execute();
while($Mas = ibase_fetch_assoc($this->sql_result))
{$i=0;
foreach($Mas as $key => $value) {
$Row[0][$i] = $key;
$Row[$j][$i] = $value;
//echo $key.": ".$value.", ";
$i++;
}
$j++;
}
return $Row;
}
示例5: next
/**
* Iterator function. Returns a rowset if called without parameter,
* the fields contents if a field is specified or FALSE to indicate
* no more rows are available.
*
* @param string field default NULL
* @return var
*/
public function next($field = NULL)
{
if (!is_resource($this->handle) || FALSE === ($row = ibase_fetch_assoc($this->handle))) {
return FALSE;
}
foreach (array_keys($row) as $key) {
if (NULL === $row[$key] || !isset($this->fields[$key])) {
continue;
}
if ('TIMESTAMP' == $this->fields[$key]) {
$row[$key] = Date::fromString($row[$key], $this->tz);
}
}
if ($field) {
return $row[$field];
} else {
return $row;
}
}
示例6: next
/**
* Iterator function. Returns a rowset if called without parameter,
* the fields contents if a field is specified or FALSE to indicate
* no more rows are available.
*
* @param string field default NULL
* @return [:var]
*/
public function next($field = null)
{
if (!is_resource($this->handle) || false === ($row = ibase_fetch_assoc($this->handle))) {
return null;
}
foreach (array_keys($row) as $key) {
if (null === $row[$key] || !isset($this->fields[$key])) {
continue;
}
if ('TIMESTAMP' == $this->fields[$key]) {
$row[$key] = new \util\Date($row[$key], $this->tz);
}
}
if ($field) {
return $row[$field];
} else {
return $row;
}
}
示例7: dbQuery
function dbQuery($query, $show_errors = true, $all_results = true, $show_output = true)
{
if ($show_errors) {
error_reporting(E_ALL);
} else {
error_reporting(E_PARSE);
}
// Connect to the Firebird/Interbase Sybase database management system
$link = ibase_pconnect("/var/www/sqlmap/dbs/firebird/testdb.fdb", "SYSDBA", "testpass");
if (!$link) {
die(ibase_errmsg());
}
// Print results in HTML
print "<html><body>\n";
// Print SQL query to test sqlmap '--string' command line option
//print "<b>SQL query:</b> " . $query . "<br>\n";
// Perform SQL injection affected query
$result = ibase_query($link, $query);
if (!$result) {
if ($show_errors) {
print "<b>SQL error:</b> " . ibase_errmsg() . "<br>\n";
}
exit(1);
}
print "<b>SQL results:</b>\n";
print "<table border=\"1\">\n";
while ($line = ibase_fetch_assoc($result)) {
// This must stay here for Firebird
if (!$show_output) {
exit(1);
}
print "<tr>";
foreach ($line as $col_value) {
print "<td>" . $col_value . "</td>";
}
print "</tr>\n";
if (!$all_results) {
break;
}
}
print "</table>\n";
print "</body></html>";
}
示例8: VerificaCalculo
private function VerificaCalculo($id) {
$SQL = "
SELECT imposto.imposto_id
FROM F_REL_F_LANCA_CR2_F_IMPOSTO RELIMP
INNER JOIN imposto ON imposto.imposto_id = RELIMP.imposto_id
WHERE RELIMP.F_LANCA_CR2_ID =
(
SELECT MAX(CR2.F_LANCA_CR2_ID)
FROM F_LANCA_CR CR
INNER JOIN F_LANCA_CR2 CR2 ON CR2.f_lanca_cr_id = CR.f_lanca_cr_id
INNER JOIN F_REL_F_LANCA_CR2_F_IMPOSTO RELIMP ON RELIMP.f_lanca_cr2_id = CR2.f_lanca_cr2_id
INNER JOIN imposto IMP ON IMP.imposto_id = RELIMP.imposto_id
WHERE CR.f_lanca_cr_id = $id
AND CR2.acao_faturar = 'S'
)";
$rsVerificaCalcular = ibase_fetch_assoc(parent::execute_query($SQL));
if (count($rsVerificaCalcular) > 0) {
return true;
} else {
return false;
}
}
示例9: _performFetch
function _performFetch($result)
{
// Select fetch mode.
$flags = $this->fetchFlags;
if (empty($this->attributes['BLOB_OBJ'])) {
$flags = $flags | IBASE_TEXT;
} else {
$flags = $flags & ~IBASE_TEXT;
}
$row = @ibase_fetch_assoc($result, $flags);
if (ibase_errmsg()) {
return $this->_setDbError($this->_lastQuery);
}
if ($row === false) {
return null;
}
return $row;
}
示例10: fetch
/**
* Fetches a row from the result set.
*
* @param int $style OPTIONAL Fetch mode for this fetch operation.
* @param int $cursor OPTIONAL Absolute, relative, or other.
* @param int $offset OPTIONAL Number for absolute or relative cursors.
* @return mixed Array, object, or scalar depending on fetch mode.
* @throws Zend_Db_Statement_Exception
*/
public function fetch($style = null, $cursor = null, $offset = null)
{
if (!$this->_stmtResult) {
return false;
}
if ($style === null) {
$style = $this->_fetchMode;
}
switch ($style) {
case Zend_Db::FETCH_NUM:
$row = ibase_fetch_row($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_ASSOC:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_BOTH:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
if ($row !== false) {
$row = array_merge($row, array_values($row));
}
break;
case Zend_Db::FETCH_OBJ:
$row = ibase_fetch_object($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_BOUND:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
if ($row !== false) {
$row = array_merge($row, array_values($row));
$row = $this->_fetchBound($row);
}
break;
default:
/**
* @see ZendX_Db_Adapter_Firebird_Exception
*/
require_once 'ZendX/Db/Statement/Firebird/Exception.php';
throw new ZendX_Db_Statement_Firebird_Exception("Invalid fetch mode '{$style}' specified");
break;
}
return $row;
}
示例11: getAll
/**
+----------------------------------------------------------
* 获得所有的查询数据
+----------------------------------------------------------
* @access private
+----------------------------------------------------------
* @return array
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
private function getAll()
{
//返回数据集
$result = array();
while ($row = ibase_fetch_assoc($this->queryID)) {
$result[] = $row;
}
//剑雷 2007.12.30 自动解密BLOB字段
//取BLOB字段清单
$bloblist = array();
$fieldCount = ibase_num_fields($this->queryID);
for ($i = 0; $i < $fieldCount; $i++) {
$col_info = ibase_field_info($this->queryID, $i);
if ($col_info['type'] == 'BLOB') {
$bloblist[] = trim($col_info['name']);
}
}
//如果有BLOB字段,就进行解密处理
if (!empty($bloblist)) {
$i = 0;
foreach ($result as $row) {
foreach ($bloblist as $field) {
if (!empty($row[$field])) {
$result[$i][$field] = $this->BlobDecode($row[$field]);
}
}
$i++;
}
}
return $result;
}
示例12: fetch_array
/**
*@package db_firebird
*@method fetch_array()
*@desc Fetch a result row as an associative array, a numeric array, or both depending on query() or query_assoc() method
*@since v0.3.1
* */
public function fetch_array($rs = '')
{
$Resource = $rs != '' ? $rs : $this->resource;
if ($this->query_is_assoc == true) {
return ibase_fetch_assoc($Resource);
} else {
return ibase_fetch_row($Resource);
}
}
示例13: getLastId
/**
* Retorna o ultimo ID da tabela para campos auto-increment
* @author Hugo Ferreira da Silva
* @param string $campo Nome do campo da tabela de auto-increment
* @return int Valor da ultima insercao
*/
public function getLastId($campo)
{
//////////////////////////////////////////////////////////////////
// GAMBIARRA FORTE!
// Aqui pegamos as triggers relacionadas a tabela
// e procuramos no corpo da trigger uma linha semelhante a
// new.nome_campo = gen_id(nome_sequencia, 1)
// para pegarmos o nome da sequencia e consequentemente
// podermos recuperar o ultimo valor
//////////////////////////////////////////////////////////////////
$cn = $this->getConnection();
$sql = "SELECT RDB\$TRIGGER_SOURCE AS triggers FROM RDB\$TRIGGERS\n\t\t\t\t WHERE (RDB\$SYSTEM_FLAG IS NULL\n\t\t\t\t\tOR RDB\$SYSTEM_FLAG = 0)\n\t\t\t\t AND RDB\$RELATION_NAME='" . $this->getTablename() . "'";
$rs = $cn->executeSQL($sql);
while ($row = ibase_fetch_assoc($rs, IBASE_FETCH_BLOBS)) {
// oba! achamos o lance
$exp = '@new\\.' . $campo . '\\s+=\\s+gen_id\\((\\w+)@is';
$res = preg_match($exp, trim($row['TRIGGERS']), $reg);
if ($res) {
ibase_free_result($rs);
$sql = "SELECT GEN_ID(" . $reg[1] . ", 0) as lastid FROM RDB\$DATABASE";
$rs = $cn->executeSQL($sql);
$row = ibase_fetch_row($rs);
ibase_free_result($rs);
return $row[0];
}
}
ibase_free_result($rs);
return 0;
}
示例14: gcms_fetch_assoc
function gcms_fetch_assoc($nresult)
{
return ibase_fetch_assoc($nresult);
}
示例15: _fetch_assoc
/**
* Result - associative array
*
* Returns the result set as an array
*
* @return array
*/
protected function _fetch_assoc()
{
return ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS);
}