本文整理汇总了PHP中odbc_fetch_into函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_fetch_into函数的具体用法?PHP odbc_fetch_into怎么用?PHP odbc_fetch_into使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_fetch_into函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: numero_filas
/**
* Devuelve la cantidad de filas de un resultado de query
*
* @access public
* @param (object) result set
* @return (int) cantidad de filas en el resulta set
*/
function numero_filas($rs)
{
// Fix para odbc_num_rows que siempre devuelve -1 para MS Access
$count = 0;
while ($temp = odbc_fetch_into($rs, $counter)) {
$count++;
}
// Reset cursor position
odbc_fetch_row($rs, 0);
return $count;
}
开发者ID:Nilphy,项目名称:moteguardian,代码行数:18,代码来源:DbODBC.php
示例2: FetchInto
function FetchInto($result, $row, &$array)
{
if ($this->php_version >= 4002000) {
return odbc_fetch_into($result, $array, $row);
} elseif ($this->php_version >= 4000005) {
return odbc_fetch_into($result, $row, $array);
} else {
eval("\$success=odbc_fetch_into(\$result,\$row,&\$array);");
return $success;
}
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:11,代码来源:metabase_odbc.php
示例3: _fetch_array
function _fetch_array($bdid)
{
global $ODBC_ID, $last_odbc_result;
if (odbc_fetch_into($bdid, $res_odbc_row)) {
foreach ($res_odbc_row as $k => $v) {
$data_odbc_row[odbc_field_name($bdid, $k + 1)] = $v;
}
return $data_odbc_row;
} else {
return False;
}
}
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:12,代码来源:odbc.inc.php
示例4: ironhacker
/**
Thanks to ironhacker (ironhacker at users.sourceforge.net) for this!
*/
function odbc_fetch_array_hack($result, $rownumber = -1)
{
$rs_assoc = array();
if (PHP_VERSION > "4.1") {
if ($rownumber < 0) {
odbc_fetch_into($result, &$rs);
} else {
odbc_fetch_into($result, &$rs, $rownumber);
}
} else {
odbc_fetch_into($result, $rownumber, &$rs);
}
foreach ($rs as $key => $value) {
$rs_assoc[odbc_field_name($result, $key + 1)] = $value;
}
return $rs_assoc;
}
开发者ID:brustj,项目名称:tracmor,代码行数:20,代码来源:db_odbc.php
示例5: Find
public function Find()
{
$conn = parent::GetConnection();
$query = $this->SetupQuery(Query::FIND_STATISTICS);
$result = odbc_exec($conn, $query);
if (!$result) {
return $this->HandleError();
}
$row = array();
if (!odbc_fetch_into($result, $row)) {
return $this->HandleError();
}
$this->idDailyTask = $row[0];
$this->StatsClass = $row[1];
$this->StartDate = $row[2];
$this->EndDate = $row[3];
return true;
}
开发者ID:hadleymj,项目名称:Senior-Design-Fall-2009,代码行数:18,代码来源:StatsDAO.php
示例6: next_record
function next_record()
{
$this->Record = array();
$this->{$stat} = odbc_fetch_into($this->Query_ID, ++$this->Row, &$this->Record);
if (!$this->{$stat}) {
if ($this->Auto_Free) {
odbc_free_result($this->Query_ID);
$this->Query_ID = 0;
}
} else {
// add to Record[<key>]
$count = odbc_num_fields($this->Query_ID);
for ($i = 1; $i <= $count; $i++) {
$this->Record[strtolower(odbc_field_name($this->Query_ID, $i))] = $this->Record[$i - 1];
}
}
return $this->Record;
}
开发者ID:phpMyChat-Plus,项目名称:phpmychat-plus,代码行数:18,代码来源:odbc.lib.php
示例7: Find
public function Find()
{
if (!parent::Find()) {
return false;
}
if ($this->StatsClass != "WalkingStats") {
return false;
}
$conn = parent::GetConnection();
$query = $this->SetupQuery(Query::FIND_WALKING_STATS);
$result = odbc_exec($conn, $query);
if (!$result) {
return $this->HandleError();
}
$row = array();
if (!odbc_fetch_into($result, $row)) {
return $this->HandleError();
}
$this->Steps = $row[0];
return true;
}
开发者ID:hadleymj,项目名称:Senior-Design-Fall-2009,代码行数:21,代码来源:WalkingStatsDAO.php
示例8: Find
public function Find()
{
if (!parent::Find()) {
return false;
}
if ($this->DailyTaskClass != "WalkingTask") {
return false;
}
$conn = parent::GetConnection();
$query = $this->SetupQuery(Query::FIND_WALKING_TASK);
$result = odbc_exec($conn, $query);
if (!$result) {
return false;
}
$row = array();
if (!odbc_fetch_into($result, $row)) {
return false;
}
$this->Steps = $row[0];
return true;
}
开发者ID:hadleymj,项目名称:Senior-Design-Fall-2009,代码行数:21,代码来源:WalkingTaskDAO.php
示例9: _odbc_fetch_array
/**
* Result - array
*
* subsititutes the odbc_fetch_array function when
* not available (odbc_fetch_array requires unixODBC)
*
* @access private
* @return array
*/
function _odbc_fetch_array(&$odbc_result)
{
$rs = array();
$rs_assoc = FALSE;
if (odbc_fetch_into($odbc_result, $rs)) {
$rs_assoc = array();
foreach ($rs as $k => $v) {
$field_name = odbc_field_name($odbc_result, $k + 1);
$rs_assoc[$field_name] = $v;
}
}
return $rs_assoc;
}
开发者ID:pmward,项目名称:Codeigniter-Braintree-v.zero-test-harness,代码行数:22,代码来源:odbc_result.php
示例10: var_dump
var_dump($rval);
$val = odbc_result($rh, 1);
var_dump($val);
// fetch_array, next
echo "testing odbc_fetch_array, next\n";
$rval = odbc_fetch_array($rh);
var_dump($rval);
// fetch_array with row number
echo "testing odbc_fetch_array with row specified\n";
$rval = odbc_fetch_array($rh, 4);
var_dump($rval);
// fetch_object, next
echo "testing odbc_fetch_object, next\n";
$rval = odbc_fetch_object($rh);
var_dump($rval);
// fetch_object with row number
echo "testing odbc_fetch_object with row specified\n";
$rval = odbc_fetch_object($rh, 4);
var_dump($rval);
// fetch_into, next
$ar = array();
echo "testing odbc_fetch_into, next\n";
$rval = odbc_fetch_into($rh, $ar);
var_dump($rval);
var_dump($ar);
// fetch_into with row number
echo "testing odbc_fetch_into with row specified\n";
$rval = odbc_fetch_into($rh, $ar, 7);
var_dump($rval);
var_dump($ar);
echo odbc_close($r);
开发者ID:jenalgit,项目名称:roadsend-php,代码行数:31,代码来源:fetches.php
示例11: tryGet
/**
* return a numeric indexed array.
*/
function tryGet()
{
$succ = odbc_fetch_into($this->query, $row);
if ($succ === false) {
return false;
} else {
return $row;
}
}
开发者ID:wistoft,项目名称:BST,代码行数:12,代码来源:gybala.php
示例12: sql_fetch_row
function sql_fetch_row(&$res, $nr = 0)
{
global $dbtype;
switch ($dbtype) {
case "MySQL":
$row = mysql_fetch_row($res);
return $row;
break;
case "mSQL":
$row = msql_fetch_row($res);
return $row;
break;
case "postgres":
case "postgres_local":
if ($res->get_total_rows() > $res->get_fetched_rows()) {
$row = pg_fetch_row($res->get_result(), $res->get_fetched_rows());
$res->increment_fetched_rows();
return $row;
} else {
return false;
}
break;
case "ODBC":
case "ODBC_Adabas":
$row = array();
$cols = odbc_fetch_into($res, $nr, $row);
return $row;
break;
case "Interbase":
$row = ibase_fetch_row($res);
return $row;
break;
case "Sybase":
$row = sybase_fetch_row($res);
return $row;
break;
default:
break;
}
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:40,代码来源:sql_layer.php
示例13: _fetch
function _fetch()
{
$row = 0;
$rez = odbc_fetch_into($this->_queryID, $row, $this->fields);
if ($rez && $this->fetchMode == ADODB_FETCH_ASSOC) {
$this->fields = $this->GetRowAssoc(false);
}
return $rez;
}
开发者ID:qoire,项目名称:portal,代码行数:9,代码来源:adodb-odbc.inc.php
示例14: db_fetch_numarray
function db_fetch_numarray(&$qhandle) {
$row=array();
odbc_fetch_into($qhandle,$row);
return $row;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:5,代码来源:dbconnection.odbc.php
示例15: fetchInto
function fetchInto($result, &$row, $fetchmode, $rownum = null)
{
$row = array();
if ($rownum !== null) {
$rownum++;
// ODBC first row is 1
if (version_compare(phpversion(), '4.2.0', 'ge')) {
$cols = odbc_fetch_into($result, $row, $rownum);
} else {
$cols = odbc_fetch_into($result, $rownum, $row);
}
} else {
$cols = odbc_fetch_into($result, $row);
}
if (!$cols) {
/* XXX FIXME: doesn't work with unixODBC and easysoft
(get corrupted $errno values)
if ($errno = odbc_error($this->connection)) {
return $this->RaiseError($errno);
}*/
return null;
}
if ($fetchmode !== DB_FETCHMODE_ORDERED) {
for ($i = 0; $i < count($row); $i++) {
$colName = odbc_field_name($result, $i + 1);
$a[$colName] = $row[$i];
}
if ($this->options['optimize'] == 'portability') {
$a = array_change_key_case($a, CASE_LOWER);
}
$row = $a;
}
return DB_OK;
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:34,代码来源:odbc.php
示例16: odbc_fetch_object
/**
* ODBC Fetch object
*
* Emulates the native odbc_fetch_object() function when
* it is not available.
*
* @param resource &$result
* @param int $rownumber
* @return object
*/
function odbc_fetch_object(&$result, $rownumber = 1)
{
$rs = array();
if (!odbc_fetch_into($result, $rs, $rownumber)) {
return FALSE;
}
$rs_object = new stdClass();
foreach ($rs as $k => $v) {
$field_name = odbc_field_name($result, $k + 1);
$rs_object->{$field_name} = $v;
}
return $rs_object;
}
开发者ID:marketcoinfork,项目名称:BitWasp-Fork,代码行数:23,代码来源:odbc_result.php
示例17: fetchInto
/**
* Fetch a row and insert the data into an existing array.
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* @param resource $result query result identifier
* @param array $arr (reference) array where data from the row
* should be placed
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch
*
* @return mixed DB_OK on success, null when end of result set is
* reached or on failure
*
* @see DB_result::fetchInto()
* @access private
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
$arr = array();
if ($rownum !== null) {
$rownum++;
// ODBC first row is 1
if (version_compare(phpversion(), '4.2.0', 'ge')) {
$cols = @odbc_fetch_into($result, $arr, $rownum);
} else {
$cols = @odbc_fetch_into($result, $rownum, $arr);
}
} else {
$cols = @odbc_fetch_into($result, $arr);
}
if (!$cols) {
/* XXX FIXME: doesn't work with unixODBC and easysoft
(get corrupted $errno values)
if ($errno = @odbc_error($this->connection)) {
return $this->RaiseError($errno);
}*/
return null;
}
if ($fetchmode !== DB_FETCHMODE_ORDERED) {
for ($i = 0; $i < count($arr); $i++) {
$colName = @odbc_field_name($result, $i + 1);
$a[$colName] = $arr[$i];
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$a = array_change_key_case($a, CASE_LOWER);
}
$arr = $a;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:58,代码来源:odbc.php
示例18: next
/**
* @see ResultSet::next()
*/
public function next()
{
if ($this->limit > 0 && $this->cursorPos >= $this->limit) {
$this->afterLast();
return false;
}
$rowNum = $this->offset + $this->cursorPos + 1;
$cols = @odbc_fetch_into($this->result->getHandle(), $this->fields, $rowNum);
if ($cols === false) {
$this->afterLast();
return false;
}
$this->cursorPos++;
if ($this->fetchmode == ResultSet::FETCHMODE_ASSOC) {
for ($i = 0, $n = count($this->fields); $i < $n; $i++) {
$colname = @odbc_field_name($this->result->getHandle(), $i + 1);
$a[$colname] = $this->fields[$i];
}
$this->fields = $a;
if (!$this->ignoreAssocCase) {
$this->fields = array_change_key_case($this->fields, CASE_LOWER);
}
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:28,代码来源:ODBCResultSet.php
示例19: getid
function getid($seq_name)
{
$this->connect();
$q = sprintf("select nextid from %s where seq_name = '%s'", $this->Seq_Table, $seq_name);
$id = @odbc_do($this->Link_ID, $q);
$res = array();
$stat = odbc_fetch_into($id, &$res);
if (!$stat) {
if ($this->Auto_Free) {
odbc_free_result($id);
$id = 0;
}
$res = "";
} else {
// add to res[<key>]
$count = odbc_num_fields($id);
for ($i = 1; $i <= $count; $i++) {
$res[strtolower(odbc_field_name($id, $i))] = $res[$i - 1];
}
}
/* No current value, make one */
if (!is_array($res)) {
$currentid = 0;
} else {
$currentid = $res["nextid"];
}
return $currentid;
}
开发者ID:antirek,项目名称:prestige-pbx,代码行数:28,代码来源:phplib_odbc.php
示例20: ListDailyTasks
public function ListDailyTasks()
{
$this->Find();
if ($this->UserClass != "Patient") {
return array();
}
$conn = parent::GetConnection();
$query = $this->SetupQuery(Query::LIST_DAILY_TASKS);
$taskArray = array();
$result = odbc_exec($conn, $query);
if (!$result) {
$this->HandleError();
return array();
}
$row = array();
while (odbc_fetch_into($result, $row)) {
$className = $row[1] . "DAO";
$taskArray[] = new $className();
$i = count($taskArray) - 1;
$taskArray[$i]->idDailyTask = $row[0];
$taskArray[$i]->Find();
}
return $taskArray;
}
开发者ID:hadleymj,项目名称:Senior-Design-Fall-2009,代码行数:24,代码来源:PatientDAO.php
注:本文中的odbc_fetch_into函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论