本文整理汇总了PHP中odbc_fetch_into函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_fetch_into函数的具体用法?PHP odbc_fetch_into怎么用?PHP odbc_fetch_into使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_fetch_into函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
示例11: tryGet
/**
* return a numeric indexed array.
*/
function tryGet()
{
$succ = odbc_fetch_into($this->query, $row);
if ($succ === false) {
return false;
} else {
return $row;
}
}
示例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;
}
}
示例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;
}
示例14: db_fetch_numarray
function db_fetch_numarray(&$qhandle) {
$row=array();
odbc_fetch_into($qhandle,$row);
return $row;
}
示例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;
}