处理语句¶
属性 | 值 |
---|---|
命名空间 | fize\db\realization\mssql\mode\driver\sqlsrv |
类名 | Statement |
方法: |
---|
方法名 | 说明 |
---|---|
__construct() | 构造 |
__destruct() | 析构 |
cancel() | 取消预处理对象,但其可以再次使用execute方法运行 |
execute() | 执行当前预处理对象。 |
fetchArray() | 以数组形式遍历记录集 |
fetchObject() | 以对象形式遍历记录集 |
fetch() | 执行该行数后指针指向下一个记录行 |
fieldMetadata() | 检索准备好的语句字段的元数据。 |
freeStmt() | 释放当前预处理语句的所有资源 |
getField() | 获取当前行的指定字段值 |
hasRows() | 判断当前预处理结果是否有记录 |
nextResult() | 将指针移动到下个记录集 |
numFields() | 获取当前记录集的字段个数 |
numRows() | 获取当前记录集的记录个数 |
rowsAffected() | 返回当前预处理语句的影响行数。 |
sendStreamData() | 如果绑定参数中含有流式数据,需要以此方法发送数据到数据库服务器。 |
方法¶
__construct()¶
构造
public function __construct (
resource &$statement
)
参数: |
|
---|
cancel()¶
取消预处理对象,但其可以再次使用execute方法运行
public function cancel () : bool
返回值: | 成功时返回 TRUE, 或者在失败时返回 FALSE,如果当前没有预处理对象也返回false。 |
---|
fetchArray()¶
以数组形式遍历记录集
public function fetchArray (
callable $func,
int $fetchType = 2,
int $row = null,
int $offset = 0
)
参数: |
|
---|
fetchObject()¶
以对象形式遍历记录集
public function fetchObject (
callable $func,
string $className = null,
array $ctorParams = null,
int $row = 6,
int $offset = null
)
参数: |
|
---|
fetch()¶
执行该行数后指针指向下一个记录行
public function fetch (
int $row = null,
int $offset = null
) : mixed
参数: |
|
||||||
---|---|---|---|---|---|---|---|
返回值: | 成功返回true,失败返回false,没有更多记录时返回null |
getField()¶
获取当前行的指定字段值
public function getField (
int $fieldIndex,
int $getAsType = null
) : mixed
参数: |
|
---|
nextResult()¶
将指针移动到下个记录集
public function nextResult () : mixed
返回值: | 成功返回true,失败返回false,没有更多记录集时返回null |
---|
sendStreamData()¶
如果绑定参数中含有流式数据,需要以此方法发送数据到数据库服务器。
public function sendStreamData () : bool
返回值: | 成功返回true,失败返回false。 |
---|