本文整理汇总了PHP中sybase_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP sybase_fetch_array函数的具体用法?PHP sybase_fetch_array怎么用?PHP sybase_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sybase_fetch_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQueryCount
public function getQueryCount($qtxt)
{
$link = $this->getDB();
$qtxt = iconv("utf-8", "gbk//ignore", $qtxt);
$query = sybase_query("exec llt_searchByPageCount " . "'" . $qtxt . "'", $link);
$row = sybase_fetch_array($query);
return $row[0];
}
示例2: sql_fetch_array
function sql_fetch_array(&$res, $nr = 0)
{
global $dbtype;
switch ($dbtype) {
case "MySQL":
$row = array();
$row = mysql_fetch_array($res);
return $row;
break;
case "mSQL":
$row = array();
$row = msql_fetch_array($res);
return $row;
break;
case "postgres":
case "postgres_local":
if ($res->get_total_rows() > $res->get_fetched_rows()) {
$row = array();
$row = pg_fetch_array($res->get_result(), $res->get_fetched_rows());
$res->increment_fetched_rows();
return $row;
} else {
return false;
}
break;
/*
* ODBC doesn't have a native _fetch_array(), so we have to
* use a trick. Beware: this might cause HUGE loads!
*/
/*
* ODBC doesn't have a native _fetch_array(), so we have to
* use a trick. Beware: this might cause HUGE loads!
*/
case "ODBC":
$row = array();
$result = array();
$result = odbc_fetch_row($res, $nr);
$nf = odbc_num_fields($res);
/* Field numbering starts at 1 */
for ($count = 1; $count < $nf + 1; $count++) {
$field_name = odbc_field_name($res, $count);
$field_value = odbc_result($res, $field_name);
$row[$field_name] = $field_value;
}
return $row;
break;
case "ODBC_Adabas":
$row = array();
$result = array();
$result = odbc_fetch_row($res, $nr);
$nf = count($result) + 2;
/* Field numbering starts at 1 */
for ($count = 1; $count < $nf; $count++) {
$field_name = odbc_field_name($res, $count);
$field_value = odbc_result($res, $field_name);
$row[$field_name] = $field_value;
}
return $row;
break;
case "Interbase":
$orow = ibase_fetch_object($res);
$row = get_object_vars($orow);
return $row;
break;
case "Sybase":
$row = sybase_fetch_array($res);
return $row;
break;
}
}
示例3: fetchInto
function fetchInto($result, &$ar, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!sybase_data_seek($result, $rownum)) {
return $this->raiseError();
}
}
$ar = $fetchmode & DB_FETCHMODE_ASSOC ? @sybase_fetch_array($result) : @sybase_fetch_row($result);
if (!$ar) {
// reported not work as seems that sybase_get_last_message()
// always return a message here
//if ($errmsg = sybase_get_last_message()) {
// return $this->raiseError($errmsg);
//} else {
return null;
//}
}
return DB_OK;
}
示例4: _fetch_array
protected function _fetch_array($result_id)
{
global $configArray;
if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
return sybase_fetch_array($result_id);
} else {
return mssql_fetch_array($result_id);
}
}
示例5: setDbLoop
//.........这里部分代码省略.........
}
while ($r = mysql_fetch_assoc($result)) {
$loop_arr[] = $r;
}
break;
case 'POSTGRESQL':
if (get_resource_type($result) != 'pgsql result') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
$nr = function_exists('pg_num_rows') ? pg_num_rows($result) : pg_numrows($result);
for ($i = 0; $i < $nr; $i++) {
$loop_arr[] = pg_fetch_array($result, $i, PGSQL_ASSOC);
}
break;
case 'INFORMIX':
if (!$result) {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = ifx_fetch_row($result, 'NEXT')) {
$loop_arr[] = $r;
}
break;
case 'INTERBASE':
if (get_resource_type($result) != 'interbase result') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = ibase_fetch_row($result)) {
$loop_arr[] = $r;
}
break;
case 'INGRES':
if (!$result) {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = ingres_fetch_array(INGRES_ASSOC, $result)) {
$loop_arr[] = $r;
}
break;
case 'MSSQL':
if (get_resource_type($result) != 'mssql result') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = mssql_fetch_array($result)) {
$loop_arr[] = $r;
}
break;
case 'MSQL':
if (get_resource_type($result) != 'msql result') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = msql_fetch_array($result, MSQL_ASSOC)) {
$loop_arr[] = $r;
}
break;
case 'OCI8':
if (get_resource_type($result) != 'oci8 statement') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while (OCIFetchInto($result, $r, OCI_ASSOC + OCI_RETURN_LOBS)) {
$loop_arr[] = $r;
}
break;
case 'ORACLE':
if (get_resource_type($result) != 'oracle Cursor') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while (ora_fetch_into($result, $r, ORA_FETCHINTO_ASSOC)) {
$loop_arr[] = $r;
}
break;
case 'OVRIMOS':
if (!$result) {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while (ovrimos_fetch_into($result, $r, 'NEXT')) {
$loop_arr[] = $r;
}
break;
case 'SYBASE':
if (get_resource_type($result) != 'sybase-db result') {
vlibTemplateError::raiseError('VT_WARNING_INVALID_RESOURCE', WARNING, $db_type);
return false;
}
while ($r = sybase_fetch_array($result)) {
$loop_arr[] = $r;
}
break;
}
$this->setLoop($loopname, $loop_arr);
return true;
}
示例6: fetch_array
function fetch_array()
{
$row = sybase_fetch_array($this->db_result);
return $row;
}
示例7: _fetch
function _fetch($ignore_fields = false)
{
if ($this->fetchMode == ADODB_FETCH_NUM) {
$this->fields = @sybase_fetch_row($this->_queryID);
} else {
if ($this->fetchMode == ADODB_FETCH_ASSOC) {
$this->fields = @sybase_fetch_assoc($this->_queryID);
if (is_array($this->fields)) {
$this->fields = $this->GetRowAssoc();
return true;
}
return false;
} else {
$this->fields = @sybase_fetch_array($this->_queryID);
}
}
if (is_array($this->fields)) {
return true;
}
return false;
}
示例8: 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)
{
if ($rownum !== null) {
if (!@sybase_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
if (function_exists('sybase_fetch_assoc')) {
$arr = @sybase_fetch_assoc($result);
} else {
if ($arr = @sybase_fetch_array($result)) {
foreach ($arr as $key => $value) {
if (is_int($key)) {
unset($arr[$key]);
}
}
}
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @sybase_fetch_row($result);
}
if (!$arr) {
// reported not work as seems that sybase_get_last_message()
// always return a message here
//if ($errmsg = @sybase_get_last_message()) {
// return $this->sybaseRaiseError($errmsg);
//} else {
return null;
//}
}
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;
}
示例9: sybase_connect
<html>
<body bgcolor=white>
<?php
$dbproc = sybase_connect("JDBC", "guest", "sybase");
if (!$dbproc) {
return;
}
$res = sybase_query("select * from test", $dbproc);
if (!$res) {
return;
}
while ($arr = sybase_fetch_array($res)) {
print $arr["i"] . " " . $arr["v"] . "<br>\n";
}
?>
</body>
</html>
示例10: currentid
function currentid($seq_name)
{
$this->connect();
$currentid = 0;
$q = sprintf("select nextid from %s where seq_name = '%s'", $this->Seq_Table, $seq_name);
$id = @sybase_query($q, $this->Link_ID);
$res = @sybase_fetch_array($id);
/* No current value, make one */
if (is_array($res)) {
$currentid = $res["nextid"];
}
return $currentid;
}
示例11: fetchInto
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@mssql_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @sybase_fetch_array($result);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @sybase_fetch_row($result);
}
if (!$arr) {
return null;
}
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;
}
示例12: GetLastInsertID
function GetLastInsertID($sTable)
{
$res = sybase_query('SELECT @@identity', $this->conn);
if ($res) {
$Record = @sybase_fetch_array($res);
sybase_free_result($res);
return $Record[0];
}
trigger_error('Could not retrieve @@identity of newly inserted record!!');
return -1;
}
示例13: fetch_assoc
/**
* Fetch a result row as an array
*
* This function fetches a result as an associative array.
*
* @param mixed $result
* @return array
* @access public
* @author Adam Greene <phpmyfaq@skippy.fastmail.fm>
* @since 2004-12-10
*/
function fetch_assoc($result)
{
if (!function_exists('sybase_fetch_assoc')) {
$rs = @sybase_fetch_array($result);
} else {
$rs = @sybase_fetch_assoc($result);
}
return $rs;
}
示例14: _fetch
function _fetch($ignore_fields = false)
{
$this->fields = @sybase_fetch_array($this->_queryID);
return $this->fields == true;
}
示例15: sybase_query
$Tstage = $med[Code1];
$Nstage = $med[Code2];
$Mstage = $med[Code3];
$stage = $med[Code4];
$ptpn = $med[Code5];
//requete sur la partie CodeDiag
$queryDIAG = "SELECT * FROM CodeDiag\n\t\t\tWHERE (CodeDiag.DiagCode='{$Diag}')";
$requeteDIAG = sybase_query($queryDIAG, $link);
//while($co=sybase_fetch_array($requeteDIAG)) {
$co = sybase_fetch_array($requeteDIAG);
$DiagT = $co[1];
//requete sur la partie CodeRegion
$queryREG = "SELECT * FROM CodeRegion\n\t\t\tWHERE (CodeRegion.RegionCode='{$Region}')";
$requeteREG = sybase_query($queryREG, $link);
//while($re=sybase_fetch_array($requeteREG)) {
$re = sybase_fetch_array($requeteREG);
$RegT = $re[RegionText];
sybase_close($link);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="textprint" height="65">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><img src="../images/UCL.jpg" width="70" height="105"></td>
<td><p><b><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Université catholique de Louvain<br>
</font></b> <font size="3"><b><font face="Verdana, Arial, Helvetica, sans-serif">Cliniques Universitaire Saint-Luc</font></b></font><br>
<font size="1">association sans but lucratif</font></p>
<font size="2">SERVICE DE RADIOTHERAPIE ONCOLOGIQUE<br>
DEPARTEMENT DE MEDECINE INTERNE </font><br>