本文整理汇总了PHP中sybase_num_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP sybase_num_rows函数的具体用法?PHP sybase_num_rows怎么用?PHP sybase_num_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sybase_num_rows函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select
function select($fields, $tables, $where = "", $order_by = "", $group_by = "", $having = "")
{
$sql_stat = " select {$fields} from {$tables} ";
if (!empty($where)) {
$sql_stat .= "where {$where} ";
}
if (!empty($group_by)) {
$sql_stat .= "group by {$group_by} ";
}
if (!empty($order_by)) {
$sql_stat .= "order by {$order_by} ";
}
if (!empty($having)) {
$sql_stat .= "having {$having} ";
}
$this->db_result = @sybase_query($sql_stat) or print "Error";
$this->db_affected_rows = @sybase_num_rows($this->db_result);
return $sql_stat;
}
示例2: num_rows
/**
* Number of rows in the result set
*
* @access public
* @return integer
*/
function num_rows()
{
return @sybase_num_rows($this->result_id);
}
示例3: numRows
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @sybase_num_rows($result);
if ($rows === false) {
return $this->sybaseRaiseError();
}
return $rows;
}
示例4: _initrs
function _initrs()
{
global $ADODB_COUNTRECS;
$this->_numOfRows = $ADODB_COUNTRECS ? @sybase_num_rows($this->_queryID) : -1;
$this->_numOfFields = @sybase_num_fields($this->_queryID);
}
示例5: lastNumRows
/**
* Returns number of rows in previous resultset. If no previous resultset exists,
* this returns false.
*
* @return integer Number of rows in resultset
*/
function lastNumRows()
{
if ($this->hasResult()) {
return @sybase_num_rows($this->_result);
}
return null;
}
示例6: sql_num_rows
function sql_num_rows($res)
{
global $dbtype;
switch ($dbtype) {
case "MySQL":
$rows = mysql_num_rows($res);
return $rows;
break;
case "mSQL":
$rows = msql_num_rows($res);
return $rows;
break;
case "postgres":
case "postgres_local":
$rows = pg_numrows($res->get_result());
return $rows;
break;
case "ODBC":
case "ODBC_Adabas":
$rows = odbc_num_rows($res);
return $rows;
break;
case "Interbase":
echo "<BR>Error! PHP dosen't support ibase_numrows!<BR>";
return $rows;
break;
case "Sybase":
$rows = sybase_num_rows($res);
return $rows;
break;
default:
break;
}
}
示例7: _num_rows
protected function _num_rows($result_id)
{
global $configArray;
if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
return sybase_num_rows($result_id);
} else {
return mssql_num_rows($result_id);
}
}
示例8: num_rows
/**
* Return the number of rows of the current result
* @return integer
*/
protected function num_rows()
{
return @sybase_num_rows($this->resResult);
}
示例9: num_rows
function num_rows()
{
return sybase_num_rows($this->Query_ID);
}
示例10: onQueryEnd
/**
* Process end of query event.
*
* @param var observable
* @param var dbevent
*/
public function onQueryEnd($obs, $arg)
{
$this->cat->info($this->getClassName() . '::onQueryEnd() Query was:', sizeof($this->queries) == 1 ? $this->queries[0] : $this->queries);
$result = $arg->getArgument();
$sc = 0;
$reads = 0;
foreach (array_keys($this->messages) as $idx) {
$msg = $this->messages[$idx];
switch ($msg['msgnumber']) {
case 3615:
$split = sscanf($msg['text'], 'Table: %s scan count %d, logical reads: (regular=%d apf=%d total=%d), physical reads: (regular=%d apf=%d total=%d), apf IOs used=%d');
$this->cat->infof('IO(%s): scan count= %d, logical= %d, physical= %d', $split[0], $split[1], $split[4], $split[7]);
// Add overall statistics
$sc += $split[1];
$reads += $split[4] + $split[7];
break;
case 3614:
$split = sscanf($msg['text'], 'Total writes for this command: %d');
if ($split[0] > 0) {
$this->cat->infof('Write-IO: %d', $split[0]);
}
break;
}
}
$this->cat->infof('Overall stats for query: scan count= %d, reads= %d', $sc, $reads);
// Retrieve number of rows returned, then calculate average cost of row
if (1 < ($nrows = sybase_num_rows($result->handle))) {
$this->cat->infof('Average stats for query: scan count= %0.02f, reads= %0.02f (%d lines)', $sc / $nrows, $reads / $nrows, $nrows);
}
$this->queries = $this->messages = array();
}
示例11: numRows
/**
* Number of rows in a result
*
* @param mixed $result
* @return integer
*/
function numRows($result)
{
return sybase_num_rows($result);
}
示例12: ExecuteScalar
function ExecuteScalar($sql)
{
$retVal = null;
if (!$this->conn) {
$this->Connect();
}
$res = sybase_query($sql, $this->conn);
if ($res) {
if (sybase_num_rows($res) > 0) {
$retVal = sybase_result($res, 0, 0);
}
sybase_free_result($res);
}
return $retVal;
}
示例13: lastNumRows
/**
* Returns number of rows in previous resultset. If no previous resultset exists,
* this returns false.
*
* @return integer Number of rows in resultset
*/
function lastNumRows()
{
if ($this->_result and is_resource($this->_result)) {
return @sybase_num_rows($this->_result);
}
return null;
}
示例14: numRows
public function numRows()
{
if (!empty($this->query)) {
return sybase_num_rows($this->query);
} else {
return 0;
}
}