ODBC预处理语句¶
| 属性 | 值 |
|---|---|
| 命名空间 | fize\db\middleware\driver\odbc |
| 类名 | Statement |
| 方法: |
|---|
| 方法名 | 说明 |
|---|---|
| __construct() | 构造 |
| binmode() | 对结果集设置处理二进制数据的模式 |
| cursor() | 返回结果游标名称 |
| execute() | 执行当前预处理语句 |
| fetchArray() | 以数组形式遍历结果集 |
| fetchInto() | 遍历结果集到指定数组 |
| fetchObject() | 以对象形式遍历结果集 |
| fetchRow() | 移动结果集指针,使用该方法后,下次使用odbc_result()将返回下一行的结果 |
| fieldLen() | 获取字段的长度(精度) |
| fieldName() | 获取字段名称 |
| fieldNum() | 获取字段下标(从1开始) |
| fieldPrecision() | 获取字段的长度(精度) |
| fieldScale() | 获取字段的小数位数 |
| fieldType() | 获取字段的类型 |
| freeResult() | 释放当前结果内存 |
| longreadlen() | 设置允许的最长字段列处理 |
| nextResult() | 对于多个结果集,将指针移到下个结果集 |
| numFields() | 返回结果中的列数 |
| numRows() | 返回结果中的行(记录)数,对于操作,则返回受影响的行数 |
| resultAll() | 将结果以HTML表格形式打印出来。 |
| result() | 获取当前结果记录的某列值 |
| setoption() | 改变属性 |
方法¶
__construct()¶
构造
public function __construct (
resource &$statement
)
| 参数: |
|
|---|
binmode()¶
对结果集设置处理二进制数据的模式
public function binmode (
int $mode
) : bool
| 参数: |
|
|---|
execute()¶
执行当前预处理语句
public function execute (
array $parameters_array = []
)
| 参数: |
|
|---|
fetchArray()¶
以数组形式遍历结果集
public function fetchArray (
int $rownumber = null
) : array
| 参数: |
|
|---|
fetchInto()¶
遍历结果集到指定数组
public function fetchInto (
array &$result_array,
int $rownumber = null
) : int
| 参数: |
|
||||||
|---|---|---|---|---|---|---|---|
| 返回值: | 返回结果行数 |
fetchObject()¶
以对象形式遍历结果集
public function fetchObject (
int $rownumber = null
) : object
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 一个对象表示一个行 |
fetchRow()¶
移动结果集指针,使用该方法后,下次使用odbc_result()将返回下一行的结果
public function fetchRow (
int $row_number = null
) : bool
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 成功返回true,失败返回false |
fieldLen()¶
获取字段的长度(精度)
public function fieldLen (
int $field_number
) : bool|int
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
fieldName()¶
获取字段名称
public function fieldName (
int $field_number
) : bool|string
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
fieldNum()¶
获取字段下标(从1开始)
public function fieldNum (
string $field_name
) : bool|int
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
fieldPrecision()¶
获取字段的长度(精度)
public function fieldPrecision (
int $field_number
) : bool|int
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
fieldScale()¶
获取字段的小数位数
public function fieldScale (
int $field_number
) : bool|int
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
fieldType()¶
获取字段的类型
public function fieldType (
int $field_number
) : bool|string
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 失败时返回false |
longreadlen()¶
设置允许的最长字段列处理
public function longreadlen (
int $length
) : bool
| 参数: |
|
|---|
resultAll()¶
将结果以HTML表格形式打印出来。
public function resultAll (
string $format = null
) : int
| 参数: |
|
||||
|---|---|---|---|---|---|
| 返回值: | 返回结果集大小,失败返回false |
setoption()¶
改变属性
public function setoption (
int $option,
int $param
) : bool
| 参数: |
|
|---|