本文整理汇总了PHP中sybase_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP sybase_fetch_array函数的具体用法?PHP sybase_fetch_array怎么用?PHP sybase_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sybase_fetch_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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];
}
开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:8,代码来源:BookSearch.php
示例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;
}
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:70,代码来源:sql_layer.php
示例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;
}
开发者ID:joeymetal,项目名称:v1,代码行数:19,代码来源:sybase.php
示例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);
}
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:9,代码来源:Horizon.php
示例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;
}
开发者ID:sulaweyo,项目名称:torrentflux-b4rt-php7,代码行数:101,代码来源:vlibTemplate.php
示例6: fetch_array
function fetch_array()
{
$row = sybase_fetch_array($this->db_result);
return $row;
}
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:5,代码来源:sybase.php
示例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;
}
开发者ID:ceryxSeidor,项目名称:ProyectoPruebaWSV2,代码行数:21,代码来源:adodb-sybase.inc.php
示例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;
}
开发者ID:sergiokessler,项目名称:perio,代码行数:60,代码来源:sybase.php
示例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>
开发者ID:johnnyzhong,项目名称:freetds,代码行数:17,代码来源:test.php
示例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;
}
开发者ID:antirek,项目名称:prestige-pbx,代码行数:13,代码来源:phplib_sybase.php
示例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;
}
开发者ID:hendricson,项目名称:couponator,代码行数:46,代码来源:mssqlm.php
示例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;
}
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.DCL_DB_sybase.inc.php
示例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 <[email protected]>
* @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;
}
开发者ID:noon,项目名称:phpMyFAQ,代码行数:20,代码来源:Sybase.php
示例14: _fetch
function _fetch($ignore_fields = false)
{
$this->fields = @sybase_fetch_array($this->_queryID);
return $this->fields == true;
}
开发者ID:qoire,项目名称:portal,代码行数:5,代码来源:adodb-sybase.inc.php
示例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>
开发者ID:lynch829,项目名称:iTP,代码行数:31,代码来源:workflowPrescription.php
示例16: listSources
/**
* Returns an array of sources (tables) in the database.
*
* @return array Array of tablenames in the database
*/
function listSources()
{
$cache = parent::listSources();
if ($cache != null) {
return $cache;
}
$result = $this->_execute("select name from sysobjects where type='U'");
if (!$result) {
return array();
} else {
$tables = array();
while ($line = sybase_fetch_array($result)) {
$tables[] = $line[0];
}
parent::listSources($tables);
return $tables;
}
}
开发者ID:quinns,项目名称:REST-API,代码行数:23,代码来源:dbo_sybase.php
示例17: die
<?php
//phpinfo();
$link = @sybase_connect('lltang2000', 'sa', '******') or die("Could not connect !");
//连接数据库,第一空必须写服务名称,不能是ip;
echo "Connected successfully<br>";
$db = @sybase_select_db("sulcmis", $link) or die("数据库没有选择");
echo "数据库选择成功<br>";
$sql = "select ctrlNo,F200,F210c from b_brief where ctrlNo<100";
$rs = sybase_query($sql, $link);
//查询表
if (!$rs) {
echo "SQL:" . $sql . "执行失败!";
exit;
}
//$sybase = sybase_fetch_array($rs);
//print_r($sybase);//结束
echo '<table border="1"><tr><td>CtrlNO</td><td>F200</td><td>F210c</td>';
while ($row = sybase_fetch_array($rs)) {
$id = $row["ctrlNo"];
$F200 = $row["F200"];
$F210c = $row["F210c"];
echo '<tr><td>' . $id . '</td><td>' . $F200 . '</td><td>' . $F210c . '</td></tr>';
}
echo '</table>';
sybase_free_result($rs);
sybase_close($link);
?>
开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:28,代码来源:index.php
示例18: listSources
/**
* Returns an array of sources (tables) in the database.
*
* @return array Array of tablenames in the database
*/
function listSources()
{
$cache = parent::listSources();
if ($cache != null) {
return $cache;
}
$result = $this->_execute("SELECT name FROM sysobjects WHERE type IN ('U', 'V')");
if (!$result) {
return array();
} else {
$tables = array();
while ($line = sybase_fetch_array($result)) {
$tables[] = $line[0];
}
parent::listSources($tables);
return $tables;
}
}
开发者ID:christianallred,项目名称:fluent_univ,代码行数:23,代码来源:dbo_sybase.php
示例19: _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_row($this->_queryID);
$this->fields = $this->GetRowAssoc(ADODB_CASE_ASSOC);
} else {
$this->fields = @sybase_fetch_array($this->_queryID);
}
}
return is_array($this->fields);
}
开发者ID:OberjukhtinIA0VWV0Allokuum,项目名称:testmasteke.leo,代码行数:14,代码来源:adodb-sybase.inc.php
示例20: 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 (!@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) {
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;
}
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:56,代码来源:sybase.php
注:本文中的sybase_fetch_array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论