本文整理汇总了PHP中mysqli_stmt::data_seek方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqli_stmt::data_seek方法的具体用法?PHP mysqli_stmt::data_seek怎么用?PHP mysqli_stmt::data_seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqli_stmt
的用法示例。
在下文中一共展示了mysqli_stmt::data_seek方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query_result
/**
* Get result data.
* @param int The row number from the result that's being retrieved. Row numbers start at 0.
* @param int The offset of the field being retrieved.
* @return array|false The contents of one cell from a MySQL result set on success, or false on failure.
*/
public function query_result($row, $field = 0)
{
if (0 == $this->result->num_rows) {
return false;
}
$this->result->data_seek($row);
$datarow = $this->result->fetch_array();
return $datarow[$field];
}
示例2: rewind
/**
* Rewind
*/
public function rewind()
{
if ($this->position !== 0) {
if ($this->isBuffered === false) {
throw new Exception\RuntimeException('Unbuffered results cannot be rewound for multiple iterations');
}
}
$this->resource->data_seek(0); // works for both mysqli_result & mysqli_stmt
$this->currentComplete = false;
$this->position = 0;
}
示例3: rewind
/**
* Rewind
*
*/
public function rewind()
{
$this->currentComplete = false;
$this->position = 0;
if ($this->resource instanceof \mysqli_stmt) {
//$this->resource->reset();
} else {
$this->resource->data_seek(0);
// works for both mysqli_result & mysqli_stmt
}
}
示例4: dataSeek
/**
* Seeks to an arbitrary row in statement result set
* @link http://www.php.net/manual/en/mysqli-stmt.data-seek.php
* @param offset int <p>
* Must be between zero and the total number of rows minus one (0..
* mysqli_stmt_num_rows - 1).
* </p>
* @return \classes\database\statement\MysqliPrepareStmt
*/
public function dataSeek($offset)
{
$this->stmt->data_seek($offset);
return $this;
}
示例5: seek
/**
* Moves internal result pointer.
*
* @param int $rowNumber Where to place the result pointer (0 = start)
* @return bool Returns TRUE on success or FALSE on failure.
* @api
*/
public function seek($rowNumber)
{
$success = $this->statement->data_seek((int) $rowNumber);
if ($this->statement instanceof \mysqli_stmt) {
// data_seek() does not return anything
$success = TRUE;
}
return $success;
}
示例6: seek
public function seek($row)
{
$this->rowNum = $row - 1;
$this->statement->data_seek($row);
return $this->next();
}