\core\drive\dbInterfaceDataBase

Summary

Methods
Constants
close()
db_usedb()
db_charset()
query()
find()
insert()
del()
update()
affected_rows()
free_result()
num_rows()
fetch_fields()
fetch_all()
fetch_assoc()
fetch_row()
fetch_object()
error_massage()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

close()

close() 

关闭数据库

db_usedb()

db_usedb(string  $name) 

选择数据库

Parameters

string $name

db_charset()

db_charset(string  $charset) 

设置字符集

Parameters

string $charset

query()

query(string  $sql) : mixed

执行未定义的SQL语句

Parameters

string $sql

Returns

mixed

find()

find(string  $table, string  $field = '*', string  $where = 1, string  $order = null, string  $limit = null) : mixed

查找记录

Parameters

string $table

表名

string $field

列名

string $where

条件

string $order

排序

string $limit

范围

Returns

mixed

insert()

insert(string  $table, string  $fields, string|array  $data) : mixed

添加数据

Parameters

string $table

表名

string $fields

更新列

string|array $data

更新内容(仅可在同时插入多条时使用数组形式)

Returns

mixed

del()

del(string  $table, string  $where) : mixed

删除数据

Parameters

string $table

表名

string $where

条件(默认不执行操作)

Returns

mixed

update()

update(string  $table, string  $data, string  $where) : mixed

修改数据

Parameters

string $table

表名

string $data

更新内容

string $where

条件(默认不执行)

Returns

mixed

affected_rows()

affected_rows() : integer

获取受影响的行数

Returns

integer

free_result()

free_result() 

释放与结果相关联的内存

num_rows()

num_rows() : integer

获取结果中的行数

Returns

integer

fetch_fields()

fetch_fields() : array

返回表示结果集中字段的对象数组

Returns

array

fetch_all()

fetch_all() 

将所有结果行作为关联数组、数字数组或两者都提取

fetch_assoc()

fetch_assoc() : array

将结果行作为关联数组获取

Returns

array

fetch_row()

fetch_row() : array

将结果行作为枚举数组获取

Returns

array

fetch_object()

fetch_object() 

将结果集的当前行作为对象返回

error_massage()

error_massage() : string

错误信息

Returns

string