本文整理汇总了PHP中resource::closeCursor方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::closeCursor方法的具体用法?PHP resource::closeCursor怎么用?PHP resource::closeCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resource
的用法示例。
在下文中一共展示了resource::closeCursor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: close
/**
* Closes the resource.
*/
public function close()
{
if ($this->_resource) {
$this->_resource->closeCursor();
}
unset($this->_resource);
$this->_resource = null;
$this->_data = [];
}
示例2: freeResult
/**
* Method to free up the memory used for the result set.
*
* @param mixed $cursor The optional result set cursor from which to fetch the row.
*
* @return void
*
* @since 1.0
*/
protected function freeResult($cursor = null)
{
$this->executed = false;
if ($cursor instanceof \PDOStatement) {
$cursor->closeCursor();
$cursor = null;
}
if ($this->prepared instanceof \PDOStatement) {
$this->prepared->closeCursor();
$this->prepared = null;
}
}
示例3: __destruct
/**
* Frees up the result object
*
* @internal
*
* @return void
*/
public function __destruct()
{
if (!is_resource($this->result) && !is_object($this->result)) {
return;
}
// stdClass results are holders for prepared statements, so we don't
// want to free them since it would break fStatement
if ($this->result instanceof stdClass) {
if ($this->database->getExtension() == 'msyqli') {
$this->result->statement->free_result();
}
unset($this->result);
return;
}
switch ($this->database->getExtension()) {
case 'ibm_db2':
db2_free_result($this->result);
break;
case 'mssql':
mssql_free_result($this->result);
break;
case 'mysql':
mysql_free_result($this->result);
break;
case 'mysqli':
mysqli_free_result($this->result);
break;
case 'oci8':
oci_free_statement($this->result);
break;
case 'odbc':
odbc_free_result($this->result);
break;
case 'pgsql':
pg_free_result($this->result);
break;
case 'sqlite':
unset($this->result);
break;
case 'sqlsrv':
sqlsrv_free_stmt($this->result);
break;
case 'pdo':
$this->result->closeCursor();
break;
}
$this->result = NULL;
}
示例4: __destruct
/**
* Frees up the result object
*
* @internal
*
* @return void
*/
public function __destruct()
{
if (!is_resource($this->result) && !is_object($this->result)) {
return;
}
switch ($this->database->getExtension()) {
case 'mssql':
mssql_free_result($this->result);
break;
case 'mysql':
mysql_free_result($this->result);
break;
case 'mysqli':
mysqli_free_result($this->result);
break;
case 'oci8':
oci_free_statement($this->result);
break;
case 'odbc':
odbc_free_result($this->result);
break;
case 'pgsql':
pg_free_result($this->result);
break;
case 'sqlite':
unset($this->result);
break;
case 'sqlsrv':
sqlsrv_free_stmt($this->result);
break;
case 'pdo':
$this->result->closeCursor();
break;
}
$this->result = NULL;
}
示例5: freeRecordSet
/**
* will free all memory associated with the result identifier result.
*
* @param resource $result query result
*
* @return bool TRUE on success or FALSE on failure.
* @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector.
*/
public function freeRecordSet($result)
{
$this->deprecated();
return $result->closeCursor();
}
示例6: freeResult
/**
* Free database result
*
* @access public
* @param resource $resource
* @return boolean
*/
function freeResult($resource) {
return $resource->closeCursor();
} // freeResult