本文整理汇总了PHP中mysqli_result::close方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqli_result::close方法的具体用法?PHP mysqli_result::close怎么用?PHP mysqli_result::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqli_result
的用法示例。
在下文中一共展示了mysqli_result::close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Close
/**
* (non-PHPdoc)
* @see Phine/Framework/Database/Interfaces/IDatabaseReader#Close()
*/
function Close()
{
if (!$this->IsClosed()) {
$this->result->close();
$this->closed = true;
}
}
示例2: loadDataFromMysqliStatement
/**
* Mysqli's binding and returning of statement values
* Mysqli requires you to bind variables to the extension in order to
* get data out. These values have to be references:
*
* @see http://php.net/manual/en/mysqli-stmt.bind-result.php
* @throws Exception\RuntimeException
* @return bool
*/
protected function loadDataFromMysqliStatement()
{
$data = null;
// build the default reference based bind structure, if it does not already exist
if ($this->statementBindValues['keys'] === null) {
$this->statementBindValues['keys'] = array();
/* @var $resultResource \mysqli_result */
$resultResource = $this->resource->result_metadata();
foreach ($resultResource->fetch_fields() as $col) {
$this->statementBindValues['keys'][] = $col->name;
}
$this->statementBindValues['values'] = array_fill(0, count($this->statementBindValues['keys']), null);
$refs = array();
foreach ($this->statementBindValues['values'] as $i => &$f) {
$refs[$i] =& $f;
}
call_user_func_array(array($this->resource, 'bind_result'), $this->statementBindValues['values']);
}
if (($r = $this->resource->fetch()) === null) {
if (!$this->isBuffered) {
$this->resource->close();
}
return false;
} elseif ($r === false) {
throw new Exception\RuntimeException($this->resource->error);
}
// dereference
for ($i = 0, $count = count($this->statementBindValues['keys']); $i < $count; $i++) {
$this->currentData[$this->statementBindValues['keys'][$i]] = $this->statementBindValues['values'][$i];
}
$this->currentComplete = true;
$this->nextComplete = true;
$this->position++;
return true;
}
示例3:
<?php
require_once "connect.inc";
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
$mysql->real_query("SELECT 'foo' FROM test_062_table_1");
$myresult = new mysqli_result($mysql);
$row = $myresult->fetch_row();
$myresult->close();
$mysql->close();
var_dump($row);
print "done!";
示例4: clear
public function clear()
{
$this->_results->close();
$this->_results = null;
$this->_num_rows = null;
}